mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
feat: introduce trigger functionality (#27644)
Signed-off-by: lyzno1 <yuanyouhuilyz@gmail.com> Co-authored-by: Stream <Stream_2@qq.com> Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zhsama <torvalds@linux.do> Co-authored-by: Harry <xh001x@hotmail.com> Co-authored-by: lyzno1 <yuanyouhuilyz@gmail.com> Co-authored-by: yessenia <yessenia.contact@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: WTW0313 <twwu@dify.ai> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
60
dev/start-beat
Executable file
60
dev/start-beat
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
# Help function
|
||||
show_help() {
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --loglevel LEVEL Log level (default: INFO)"
|
||||
echo " --scheduler SCHEDULER Scheduler class (default: celery.beat:PersistentScheduler)"
|
||||
echo " -h, --help Show this help message"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " $0"
|
||||
echo " $0 --loglevel DEBUG"
|
||||
echo " $0 --scheduler django_celery_beat.schedulers:DatabaseScheduler"
|
||||
echo ""
|
||||
echo "Description:"
|
||||
echo " Starts Celery Beat scheduler for periodic task execution."
|
||||
echo " Beat sends scheduled tasks to worker queues at specified intervals."
|
||||
}
|
||||
|
||||
# Parse command line arguments
|
||||
LOGLEVEL="INFO"
|
||||
SCHEDULER="celery.beat:PersistentScheduler"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--loglevel)
|
||||
LOGLEVEL="$2"
|
||||
shift 2
|
||||
;;
|
||||
--scheduler)
|
||||
SCHEDULER="$2"
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
cd "$SCRIPT_DIR/.."
|
||||
|
||||
echo "Starting Celery Beat with:"
|
||||
echo " Log Level: ${LOGLEVEL}"
|
||||
echo " Scheduler: ${SCHEDULER}"
|
||||
|
||||
uv --directory api run \
|
||||
celery -A app.celery beat \
|
||||
--loglevel ${LOGLEVEL} \
|
||||
--scheduler ${SCHEDULER}
|
||||
Reference in New Issue
Block a user