Scheduler

Scheduler for running API syncs on defined intervals or cron schedules.

class apilinker.core.scheduler.Scheduler[source]

Bases: object

Scheduler for running API sync operations on defined schedules.

This class handles scheduling of sync operations based on: - Interval: Run every N minutes/hours - Cron: Run according to cron expression - One-time: Run once at a specific time

add_schedule(type: str, **kwargs) None[source]

Configure the schedule for sync operations.

Parameters:
  • type – Type of schedule (‘interval’, ‘cron’, or ‘once’)

  • **kwargs – Schedule-specific parameters

get_schedule_info() str[source]

Get human-readable description of the current schedule.

start(callback: Callable[[...], Any], *args: Any, **kwargs: Any) None[source]

Start the scheduler with the provided callback function.

Parameters:
  • callback – Function to call on schedule

  • *args – Arguments to pass to the callback

  • **kwargs – Arguments to pass to the callback

stop() None[source]

Stop the scheduler.