first commit

This commit is contained in:
2025-11-06 03:25:44 -06:00
commit 38a9fb2789
17 changed files with 1153 additions and 0 deletions

29
app/tasks/example_task.py Normal file
View File

@@ -0,0 +1,29 @@
# tasks/example_task.py
import logging
logger = logging.getLogger(__name__)
from utils.settings import get_settings
# ----------------------
# TASK CONFIG
# ----------------------
TASK_CONFIG = {
"name": "ExampleTask", # Name of the task
"cron": "*/1 * * * *", # Runs every minute (crontab format) (note the day is actually -1 from cron per APschedule docs)
"enabled": True, # If False, task is ignored
"run_when_loaded": True # If True, runs immediately on scheduler start
}
# ----------------------
# TASK LOGIC
# ----------------------
def main():
settings = get_settings()
"""
This is the entry point of the task.
TasksMaster will call this function based on the cron schedule.
"""
logger.info(f"ExampleTask is running! - Setting: {settings.app.name} was found!")
# Your task logic here