Skip to content

Commit 05fb028

Browse files
committed
type for transaction chunks
1 parent 2149c0c commit 05fb028

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/mergin/sync/tasks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import time
99
from datetime import datetime, timedelta, timezone
10+
from typing import List, Optional
1011
from zipfile import ZIP_DEFLATED, ZipFile
1112
from flask import current_app
1213

@@ -172,8 +173,10 @@ def remove_unused_chunks():
172173

173174

174175
@celery.task
175-
def remove_transaction_chunks(chunks=[]):
176+
def remove_transaction_chunks(chunks: Optional[List[str]] = None):
176177
"""Remove chunks related to a specific sync transaction"""
178+
if not chunks:
179+
return
177180
for chunk in chunks:
178181
chunk_path = get_chunk_location(chunk)
179182
if os.path.exists(chunk_path):

0 commit comments

Comments
 (0)