Skip to content

feat(scheduler): add scheduler:daemon command with time-limited execution#311

Merged
usernane merged 2 commits intomainfrom
dev
Apr 29, 2026
Merged

feat(scheduler): add scheduler:daemon command with time-limited execution#311
usernane merged 2 commits intomainfrom
dev

Conversation

@usernane
Copy link
Copy Markdown
Member

Summary

Add a scheduler:daemon CLI command that runs the scheduler in a loop for a configurable duration, intended for local development and testing.

Motivation

Developers need a way to test scheduled tasks locally without setting up OS-level cron. scheduler:run executes once and exits. This command loops every 60 seconds and self-terminates after the specified duration. Fixes #300.

Changes

  • Added SchedulerDaemonCommand class with --max-minutes argument (default: 60)
  • Registered the command in App.php
  • Updated HelpCommandTest expected output to include the new command

How to Test / Verify

php webfiori scheduler:daemon --max-minutes=1

The command will run the scheduler check every 60 seconds and exit after 1 minute.

Breaking Changes and Migration Steps

None

Checklist

  • I reviewed my own diff before requesting review
  • My commits follow Conventional Commits
  • The title of the pull request follows Conventional Commits
  • I added/updated tests (or explained why not)
  • I updated docs (if needed)
  • I ran lint/cs-fixer (if applicable)
  • I considered backward compatibility
  • I considered security

Related issues

Closes #300

Ibrahim BinAlshikh added 2 commits April 30, 2026 00:58
…tion

Adds a new CLI command that runs the scheduler in a loop every 60
seconds for a configurable duration (default: 60 minutes). Intended
for local development and testing without OS-level cron setup.

Usage:
  php webfiori scheduler:daemon
  php webfiori scheduler:daemon --max-minutes=5

Fixes #300
Tests cover:
- No tasks registered (early exit)
- Invalid --max-minutes values (zero and negative)
- Wrong scheduler password
- Command name and description metadata
@usernane usernane merged commit 2c2efde into main Apr 29, 2026
3 of 6 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.88%. Comparing base (c24817d) to head (854a64b).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #311   +/-   ##
=========================================
  Coverage     74.88%   74.88%           
  Complexity     2976     2976           
=========================================
  Files            97       97           
  Lines          9512     9513    +1     
=========================================
+ Hits           7123     7124    +1     
  Misses         2389     2389           
Flag Coverage Δ
php-8.1 76.20% <ø> (ø)
php-8.2 76.15% <ø> (ø)
php-8.3 74.95% <100.00%> (+<0.01%) ⬆️
php-8.4 74.95% <100.00%> (+<0.01%) ⬆️
php-8.5 74.86% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scheduler): add scheduler:daemon command with time-limited execution

1 participant