INNER CODE UNIT · Python

_add_job

MichielMe/fastscheduler · src/fastscheduler/main.py:236

    def _add_job(self, job: Job):
        """Add job to the priority queue."""
        with self.lock:
            if any(j.job_id == job.job_id for j in self.jobs):
                logger.warning(f"Job {job.job_id} already exists, skipping")
                return

            heapq.heappush(self.jobs, job)
            self._log_history(job.job_id, job.func_name, JobStatus.SCHEDULED)

            schedule_desc = job.get_schedule_description()
            if not self.quiet:
                logger.info(f"Scheduled: {job.func_name} - {schedule_desc}")

        self._save_state_async()

    def _log_history(
        self,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…