• 欢迎 游客 您的光临,下载之前请先阅读 积分规则(暂行) 。任何技术问题请在论坛提问,本站定制插件、模板主题。售前、售后问题请联系QQ:5916171
  • 发帖需要扣除两点虚拟积分是为了控制乱发广告,如不便可进群提问。点击链接加入群聊【XenForo讨论社区】:群号1:143277648
CLI Job / Cron Runner

插件 CLI Job / Cron Runner 2.1.0

没有下载权限
兼容版本
  1. 2.2
语言
英文 (English)
This XenForo 2.2 addon implements an advanced CLI triggered job runner for use with Unix cron as a replacement for the built-in xf:run-jobs command introduced in XF 2.2

The command is calledhg:run-jobs and does the same thing thatxf:run-jobs does, but with more options and functionality.

Features

Main features of this addon:xf:run-jobs hg:run-jobs xf:run-jobs
  • allows commands to process jobs/crons for up to 10 minutes at a time, even when triggered every minute from a cron task (uses a lock file to prevent multiple executions in parallel) - ideal for improving job performance on high traffic sites
  • extensive debugging output available for testing and identifying issues with jobs and cron tasks
  • drop-in replacement for xf:run-jobs
  • command to list all outstanding Jobs hg:show-jobs
  • command to list all XF Cron tasks hg:show-crons
  • command to execute an XF Cron task hg:run-cron
Requirements

This addon requires PHP 7.0 or higher and has been tested on XenForo 2.2.0

Installation


Install as per normal addon installation.

Once installed, go to the System and performance options page as change the Job run trigger setting to "Server based trigger"
1596700351453.png

First, you should test that your job runner is functioning - execute the following command from your CLI:

Bash:
$ php <path to your forum root>/cmd.php hg:run-jobs

For example, if your forum root is/srv/www/xenforo/community, then the job runner command would be:

Bash:
$ php /srv/www/xenforo/community/cmd.php hg:run-jobs

Running this command will execute any outstanding jobs and then finish with a message about whether there are more jobs waiting to be executed or not. When executing this command from cron, it is recommended that you use the--quiet (or -q) flag to suppress output.

Once you are happy that the job runner functions correctly, you will need to create your own cron task to run it on a schedule of your choosing.

Once you are happy that the job runner functions correctly, you will need to create your own cron task to run it on a schedule of your choosing.

NOTE: if you already have a cron task set up to run xf:run-jobs simply disable that and replace it with an identical task which runs hg:run-jobs instead.

Approach #1 using crontab:

It is highly recommended that you have your cron task run as the web server user to prevent potential permission problems.

For example, on Ubuntu with a web server user of www-data, install a cron task by running the following command:

Bash:
$ sudo crontab -u www-data -e

后边太多懒得弄了 :ROFLMAO:
作者
死了算了
下载
2
查看
220
首次发布
最后更新
评分
0.00 星 0 星

来自死了算了的更多资源

分享资源

顶部 底部