Skip to content

Commit

Permalink
Merge pull request #138 from endlessm/T34697-kolibri-content-cleanups
Browse files Browse the repository at this point in the history
eibkolibri: Back off a bit when checking job status
  • Loading branch information
wjt committed Dec 7, 2023
2 parents 2b194d4 + 103859f commit 6406ebe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/eibkolibri.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from netrc import netrc
import os
import requests
from time import sleep
from urllib.parse import urljoin, urlparse

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -62,6 +63,9 @@ def wait_for_job(session, base_url, job_id):
logger.info(f'Progress: {pct}%')
last_marker = marker

# Wait a bit before checking the status again.
sleep(0.5)


def channel_exists(session, base_url, channel_id):
"""Check if channel exists on remote Kolibri server"""
Expand Down Expand Up @@ -170,7 +174,7 @@ def seed_remote_channels(channel_ids):
host = urlparse(base_url).netloc
creds = netrc_creds.authenticators(host)
if not creds:
logger.info(f'No credentials for {host}')
logger.info(f'No credentials for {host} in {netrc_path}')
return
username, _, password = creds

Expand Down

0 comments on commit 6406ebe

Please sign in to comment.