scheduler.main_scheduler

Main scheduler file.

Module Contents

class scheduler.main_scheduler.SchedulerConfig

Start the scheduler and add notification jobs for 3 AM.

add_deadline_late_notification(self, course_id)

Add scheduler job to send notifications for missed deadlines at 3 AM.

Parameters

course_id (int) – Course to check the deadlines for.

add_deadline_early_notification(self, course_id, time_before)

Add scheduler job to send notifications for upcoming deadlines at 3 AM.

Parameters
  • course_id (int) – Course to check the deadlines for.

  • time_before (int) – Time in seconds the user should be warned in advance.

add_inactivity_notification(self, course_id, inactivity_time)

Add scheduler job to send notifications for inactivity of students at 3 AM.

Parameters
  • course_id (int) – Course to check the deadlines for.

  • inactivity_time (int) – Number of days the activity needs to be checked for, default is 7 days.

add_cron_job(self, function, job_name, args=None)

Add a cron job to the scheduler.

Parameters
  • function – The function that needs to be performed by the cron job.

  • args (all types) – Arguments that are needed to be send with the function.

Type

function or str

Returns

The job that is created.

Return type

job

remove_job(self, course_id, job_type)

Remove a scheduled job.

Parameters
  • course_id (int) – The course id.

  • job_type (str) – The type of job for the course. Can be ‘late’, ‘early’ or ‘inactive’.