Skip to content

Commit

Permalink
eibkolibri: Follow channel update with channel import
Browse files Browse the repository at this point in the history
If new nodes are added in a new channel version, the channel needs to be
updated or they will be skipped if they're below an already existing
node. However, if there are missing nodes from a previously failed
import, then a regular import is needed. Therefore, follow a channel
update with a channel import.

The update is run first because the algorithm for calculating newly
needed nodes depends on comparing the old and new versions of the
channel metadata. One a regular import is done, the old version of the
channel metadata is replaced and the calculation can't be made anymore.

https://phabricator.endlessm.com/T34697
  • Loading branch information
dbnicholson committed Dec 13, 2023
1 parent 60c7192 commit 1461e73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/eibkolibri.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ def seed_channel(self, channel_id):
"""Import or update channel and content on remote Kolibri server
If the channel exists, it will be updated since Kolibri won't
import new content nodes otherwise.
import new content nodes otherwise. An import is always run to
ensure any nodes missed because of a previous failure are
imported.
"""
if self._channel_exists(channel_id):
self.update_channel(channel_id)
else:
self.import_channel(channel_id)
self.import_channel(channel_id)

def _get_server_series(self):
"""Determine the server Kolibri series"""
Expand Down

0 comments on commit 1461e73

Please sign in to comment.