PHP code example of sayhey / ssjobs

1. Go to this page and download the library: Download sayhey/ssjobs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sayhey / ssjobs example snippets


# 引入
# 拷贝config_example.php到自己的项目中,并按需修改
# 在项目中新建入口文件,如ssjobs.php,核心内容如下:
nfig_example.php的结构即可
$console->run();

# 使用
# php 项目目录/ssjobs.php

用法:
  command [options]

可用命令:
  help              打印帮助信息
  start             启动
  stop              停止
  restart           重启
  revive            复活
  status            查看状态
  check             检查配置

# 建议定期重启jobs,可使用crontab:
0 0 * * * php 项目目录/ssjobs.php restart   # 定时重启,未运行时直接运行,运行中则先平滑退出,再启动
1 0 * * * php 项目目录/ssjobs.php revive    # 未运行则启动,应对上一步的重启失败