def _start_job(survey_job: SurveyJob) -> SurveyJob: """Start survey job, setting time properties.""" logger.debug("Starting Survey Job for source type: %s.", survey_job.source_type, survey_job=survey_job.id) survey_job.start_time = timezone.now() survey_job.save() global CURRENT_JOB CURRENT_JOB = survey_job return survey_job
def _start_job(survey_job: SurveyJob): logger.info("Starting Survey Job for source type: %s.", survey_job.source_type, survey_job=survey_job.id) survey_job.start_time = timezone.now() survey_job.replication_started_at = timezone.now() # If the end of the replication range is not already set, # set it to the current time. if survey_job.replication_ended_at is None: survey_job.replication_ended_at = timezone.now() survey_job.save()