Skip to content
Snippets Groups Projects

Draft: 471 sync script invariant start time

Closed Florian Gransee requested to merge 471-sync_script-invariant-start-time into main
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
95 command = f"{script} {uuid} {keyfile} > $STDOUT 2> $STDERR"
96 job.enable(enabled=thing.external_sftp.enabled)
97 job.set_comment(comment, pre_comment=True)
98 # if the interval has changed we want to ensure consistent starting dates
99 if current_interval != new_interval:
100 schedule = cls.update_cron_expression(job, new_interval)
101 else:
102 schedule = str(job.slices)
103 job.setall(schedule)
104 job.set_command(command)
105 info = f"sFTP {thing.external_sftp.uri} @ {new_interval}s and schedule {schedule}"
106 if thing.external_api is not None:
107 new_interval = int(thing.external_api.sync_interval)
108 script = f"/scripts/sync_{thing.external_api.api_type}_api.py"
109 target_uri = thing.database.url
110 command = f"""{script} {uuid} "{thing.external_api.settings}" {target_uri} > $STDOUT 2> $STDERR"""
  • Suggested change
    110 command = f"""{script} {uuid} "{thing.external_api.settings}" {target_uri} > $STDOUT 2> $STDERR"""
    110 command = f"{script} {uuid} '{thing.external_api.settings}' {target_uri} > $STDOUT 2> $STDERR"
  • Please register or sign in to reply
  • Florian Gransee marked this merge request as draft

    marked this merge request as draft

  • Please register or sign in to reply
    Loading