MIT License

项目介绍

django-commons/django-tasks-scheduler 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 231 个 Star、31 次 Fork。

仓库全名
django-commons/django-tasks-scheduler
开源许可证
MIT License
Star 数
231
Fork 数
31

README 摘要

Django Tasks Scheduler =================== Documentation can be found in https://django-tasks-scheduler.readthedocs.io/ Introduction Video Watch this introduction video to learn about django-tasks-scheduler and its features. Usage 1. Update settings.py to include scheduler configuration: 2. Update urls.py to include scheduler urls: 3. Run migrations: 4. Check out the admin views: Local development environment You…

完整内容见 GitHub 原始 README 或本页 。

常见问题

django-tasks-scheduler 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 231 个 Star。

django-tasks-scheduler 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 django-tasks-scheduler 的源码?

可以直接克隆仓库:git clone https://github.com/django-commons/django-tasks-scheduler.git,默认分支为 master;安装与运行步骤见仓库 README。

django-tasks-scheduler 最近还在维护吗?

仓库最近一次更新为 1 周前,当前没有未关闭的 Issue;Star 数为 231,可作为社区活跃度的参考。

关于

Schedule async tasks using redis protocol. Redis/ValKey/Dragonfly or any broker using the redis protocol can be used.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
297
价值分
148
活跃状态
活跃

语言占比

HTML
JavaScript
Python

Release

README

Django Tasks Scheduler

Django CI badge badge

Documentation can be found in https://django-tasks-scheduler.readthedocs.io/

Introduction Video

Django Tasks Scheduler Introduction

Watch this introduction video to learn about django-tasks-scheduler and its features.

Usage

  1. Update settings.py to include scheduler configuration:
import os
from typing import Dict
from scheduler.types import SchedulerConfiguration, Broker, QueueConfiguration

INSTALLED_APPS = [
    # ...
    "scheduler",
    # ...
]
SCHEDULER_CONFIG = SchedulerConfiguration(
    EXECUTIONS_IN_PAGE=20,
    SCHEDULER_INTERVAL=10,
    BROKER=Broker.REDIS,
    CALLBACK_TIMEOUT=60,  # Callback timeout in seconds (success/failure/stopped)
    # Default values, can be overridden per task/job
    DEFAULT_SUCCESS_TTL=10 * 60,  # Time To Live (TTL) in seconds to keep successful job results
    DEFAULT_FAILURE_TTL=365 * 24 * 60 * 60,  # Time To Live (TTL) in seconds to keep job failure information
    DEFAULT_JOB_TTL=10 * 60,  # Time To Live (TTL) in seconds to keep job information
    DEFAULT_JOB_TIMEOUT=5 * 60,  # timeout (seconds) for a job
    # General configuration values
    DEFAULT_WORKER_TTL=10 * 60,  # Time To Live (TTL) in seconds to keep worker information after last heartbeat
    DEFAULT_MAINTENANCE_TASK_INTERVAL=10 * 60,  # The interval to run maintenance tasks in seconds. 10 minutes.
    DEFAULT_JOB_MONITORING_INTERVAL=30,  # The interval to monitor jobs in seconds.
    SCHEDULER_FALLBACK_PERIOD_SECS=120,  # Period (secs) to wait before requiring to reacquire locks
)
SCHEDULER_QUEUES: Dict[str, QueueConfiguration] = {
    "default": QueueConfiguration(URL="redis://localhost:6379/0"),
}
  1. Update urls.py to include scheduler urls:
from django.urls import path, include

urlpatterns = [
    # ...
    path("scheduler/", include("scheduler.urls")),
]
  1. Run migrations:
python manage.py migrate
  1. Check out the admin views:

Local development environment

You can install pre-commit hook in the repo to add it as a git hook by running: pre-commit install. It is configured to check all change files based on configuration in .pre-commit-config.yaml.

django-tasks-scheduler is developed for free.

You can support this project by becoming a sponsor using this link.

Contributing

Interested in contributing, providing suggestions, or submitting bugs? See guidelines at this link.

评论

暂无评论