Skip to content

docs(install): Scheduled jobs, the queue and Redis - #111

Merged
marcelfolaron merged 5 commits into
masterfrom
docs/scheduled-jobs-redis
Nov 23, 2026
Merged

marcelfolaron merged 5 commits into
masterfrom
docs/scheduled-jobs-redis

Conversation

@gloriafolaron

Copy link
Copy Markdown
Contributor

A new page, Scheduled jobs, the queue and Redis (installation/scheduled-jobs-and-redis.md, self-hosted only). Checked on Leantime 3.15.3.

What the page covers

  • What runs in the background: every scheduled job, how often it runs and what it does, from schedule:list on 3.15.3. Plugins can add their own jobs (CalDAV's caldav-sync is the example).
  • How to run the jobs:
    • Docker does it already.
    • On your own server: cron or schedule:work.
    • On shared hosting: a cron job every 5 minutes works, and an outside service can open /cron/run (no sign-in needed).
  • What happens without a cron job:
    • The jobs run only from a signed-in browser, every 5 minutes.
    • The daily jobs run at midnight in LEAN_DEFAULT_TIMEZONE, so most days they're skipped: report snapshots, plugin license checks and plugin updates.
    • LEAN_POOR_MANS_CRON=false turns off the browser requests once cron runs.
  • Queue worker: not needed. The queue lives in Leantime's own database and the scheduled jobs empty it.
  • Checking the jobs: schedule:list, schedule:test and the logs.
  • When Redis helps: more than one Leantime server. They share sign-ins, the cache and the sign-in limits.
  • Setting up Redis:
    • the settings and a Docker Compose service;
    • separate databases for sign-ins and the cache;
    • what happens when Redis stops.

Tested on throwaway 3.15.3 containers (removed after)

  • LEAN_REDIS_SCHEME not set: Leantime connects with TLS. Pages hang until they time out, and the scheduler exits with "SSL: Handshake timed out".
  • LEAN_REDIS_SCHEME = '' (as in the Docker sample.env): every page returns 500.
  • What works:
    • tcp, or LEAN_REDIS_URL = 'tcp://…' on its own;
    • LEAN_REDIS_PASSWORD;
    • sign-ins in Redis db 1, and the cache and rate-limit counters in db 0;
    • cache:clear keeps people signed in;
    • sign-ins survive recreating the container;
    • with Redis stopped, pages return 500, and they work again once Redis is back.
  • LEAN_POOR_MANS_CRON=false removes the browser's /cron/run requests.
  • /cron/run answers 200 with an empty body, without sign-in.

Other pages

  • configuration.md: the Cron Jobs section is shorter and points to the new page. The #cron-jobs anchor stays.
  • shared-hosting.md: the cron job was said to send "reminders". It's now notification emails and the daily jobs, with links to the new page.
  • plugin-licenses.md: it said the daily checks also run while people are signed in. Without cron they're usually skipped; the page now says so and links to the new page.
  • commandline.md, email-configuration.md, plugins/recurring-todos.md and using-leantime/notifications.md: cron links point to the new page.
  • _sidebar.md: "Scheduled jobs and Redis" under Configuration.

The Starlight branch (#63) gets the page's metadata and a menu entry after Reverse proxy (a9b6195).

Checks

On the #63 build:

🤖 Generated with Claude Code

https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

…background, cron, and Redis setup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The deployment guidance can cause Redis authentication failures and duplicate notification emails, and omits matching settings required for shared caches and sign-in limits.

3 open issues
What changed in this PR

Adds a central self-hosting guide for scheduled jobs, queue processing, and Redis, with related documentation pointing to it.

Changes:

  • Documents scheduler setup, browser-triggered fallback limitations, and troubleshooting.
  • Explains when Redis helps, how to configure it, and what happens during an outage.
  • Updates cron guidance and adds the new page to navigation.
File Description
using-leantime/​notifications.md Points delayed-email troubleshooting to the new guide.
plugins/​recurring-todos.md Updates scheduler setup and troubleshooting links.
installation/​shared-hosting.md Clarifies cron responsibilities and links setup guidance.
installation/​scheduled-jobs-and-redis.md Adds the scheduler, queue, and Redis guide.
installation/​plugin-licenses.md Clarifies when daily license checks may be skipped.
installation/​email-configuration.md Updates the scheduler setup link.
installation/​configuration.md Shortens cron guidance while preserving its anchor.
development/​commandline.md Notes skipped daily jobs and links the new guide.
_sidebar.md Adds the guide under Configuration.

Review effort: Balanced

…and session key, no password for the Compose example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the scheduled jobs, queue, and Redis documentation changes.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

marcelfolaron and others added 2 commits November 22, 2026 21:20
…e isn't tied to 3.15

Leantime 3.16.0 adds a daily oauth:purge job (Domain/Oauth/register.php).
The Docker image's supervisord always starts schedule:work, whatever the
Leantime version, so drop "in 3.15".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ConsoleKernel::schedule() sets schedule_timezone to UTC, so the daily jobs
don't follow LEAN_DEFAULT_TIMEZONE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcelfolaron

Copy link
Copy Markdown
Contributor

Pushed two commits: the daily jobs run at midnight UTC (ConsoleKernel::schedule() sets schedule_timezone to UTC), not in LEAN_DEFAULT_TIMEZONE; the job table gains 3.16's daily oauth:purge; and the Docker note no longer says "in 3.15", since the image's supervisord always starts schedule:work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@marcelfolaron
marcelfolaron merged commit c21c2c3 into master Nov 23, 2026
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.

3 participants