feat(MAT-174): Add cron job scheduler and executors
Cron package that syncs jobs from matrixhost portal API, schedules execution with timezone-aware timing, and posts results to Matrix rooms. Includes Brave Search, reminder, and browser scrape (placeholder) executors with formatter. 31 pytest tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
20
cron/reminder.py
Normal file
20
cron/reminder.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Simple reminder executor for cron jobs."""
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def execute_reminder(job: dict, send_text, **_kwargs) -> dict:
|
||||
"""Post a reminder message to a Matrix room."""
|
||||
config = job.get("config", {})
|
||||
message = config.get("message", "")
|
||||
target_room = job["targetRoom"]
|
||||
|
||||
if not message:
|
||||
return {"status": "error", "error": "No reminder message configured"}
|
||||
|
||||
text = f"\u23f0 **{job['name']}:** {message}"
|
||||
await send_text(target_room, text)
|
||||
|
||||
return {"status": "success"}
|
||||
Reference in New Issue
Block a user