[PR #28550] feat: add configurable celery beat schedule filename #32082

Open
opened 2026-02-21 20:50:43 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/28550

State: open
Merged: No


Fixes #28530

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

This change adds support for customizing the Celery Beat schedule file path via the CELERY_BEAT_SCHEDULE_FILENAME environment variable.
This is useful in Kubernetes environments where the root filesystem is read-only, as Celery Beat cannot create its default schedule file.
By allowing the schedule file location to be configured (e.g., /tmp/celerybeat-schedule.db), deployments can avoid write-permission issues without modifying the application code.

No additional dependencies are introduced by this change.

You can verify the correctness of this change in the official Celery documentation.
Celery Beat supports customizing the schedule database path using the --schedule (-s) option, as described here:

https://docs.celeryq.dev/en/stable/reference/cli.html#beat

According to the documentation, the --schedule option allows specifying an alternative path for the schedule file instead of the default celerybeat-schedule.
This confirms that providing a custom schedule file path (e.g., via the CELERY_BEAT_SCHEDULE_FILENAME environment variable) is an intended and supported behavior in Celery.

Screenshots

Before After
スクリーンショット 2025-11-23 16 02 13 スクリーンショット 2025-11-23 15 39 46

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/28550 **State:** open **Merged:** No --- Fixes #28530 > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary This change adds support for customizing the Celery Beat schedule file path via the CELERY_BEAT_SCHEDULE_FILENAME environment variable. This is useful in Kubernetes environments where the root filesystem is read-only, as Celery Beat cannot create its default schedule file. By allowing the schedule file location to be configured (e.g., /tmp/celerybeat-schedule.db), deployments can avoid write-permission issues without modifying the application code. No additional dependencies are introduced by this change. You can verify the correctness of this change in the official Celery documentation. Celery Beat supports customizing the schedule database path using the --schedule (-s) option, as described here: https://docs.celeryq.dev/en/stable/reference/cli.html#beat According to the documentation, the --schedule option allows specifying an alternative path for the schedule file instead of the default celerybeat-schedule. This confirms that providing a custom schedule file path (e.g., via the CELERY_BEAT_SCHEDULE_FILENAME environment variable) is an intended and supported behavior in Celery. ## Screenshots | Before | After | |--------|-------| | <img width="576" height="70" alt="スクリーンショット 2025-11-23 16 02 13" src="https://github.com/user-attachments/assets/8d50bc76-030f-466a-8b46-fddc1c9c2ef1" /> | <img width="726" height="369" alt="スクリーンショット 2025-11-23 15 39 46" src="https://github.com/user-attachments/assets/5faf858d-5f7b-4c5d-8ede-5fb052aa06cc" /> | ## Checklist - [x] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:50:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32082