Skip to content

Commit 24089b6

Browse files
committed
Use update_progress: otherwise endless 'status':'COMPLETED' updates sent
1 parent d2ab5c7 commit 24089b6

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

kolibri/tasks/api.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ def localdrive(self, request):
143143

144144

145145
def _networkimport(channel_id, update_progress=None):
146-
call_command("importchannel", "network", channel_id)
146+
call_command(
147+
"importchannel",
148+
"network",
149+
channel_id,
150+
update_progress=update_progress)
147151
call_command(
148152
"importcontent",
149153
"network",
@@ -154,8 +158,14 @@ def _networkimport(channel_id, update_progress=None):
154158
def _localimport(drive_id, update_progress=None):
155159
drives = get_mounted_drives_with_channel_info()
156160
drive = drives[drive_id]
161+
# copy channel's db file then copy all the content files from sorage dir
157162
for channel in drive.metadata["channels"]:
158-
call_command("importchannel", "local", channel["id"], drive.datafolder)
163+
call_command(
164+
"importchannel",
165+
"local",
166+
channel["id"],
167+
drive.datafolder,
168+
update_progress=update_progress)
159169
call_command(
160170
"importcontent",
161171
"local",
@@ -168,7 +178,11 @@ def _localexport(drive_id, update_progress=None):
168178
drives = get_mounted_drives_with_channel_info()
169179
drive = drives[drive_id]
170180
for channel in ChannelMetadataCache.objects.all():
171-
call_command("exportchannel", channel.id, drive.datafolder)
181+
call_command(
182+
"exportchannel",
183+
channel.id,
184+
drive.datafolder,
185+
update_progress=update_progress)
172186
call_command(
173187
"exportcontent",
174188
channel.id,

0 commit comments

Comments
 (0)