登录
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace app\process;
|
||||
|
||||
use Workerman\Crontab\Crontab;
|
||||
use app\common\utils\email\Emails as EmailsUtils;
|
||||
|
||||
class Emails
|
||||
{
|
||||
|
||||
public function onWorkerStart()
|
||||
{
|
||||
// // 拉取新邮件
|
||||
// new Crontab('0 */30 * * * *', function(){
|
||||
// $email = new EmailsUtils();
|
||||
// $email->uids();
|
||||
// });
|
||||
|
||||
// // 邮件详情
|
||||
// new Crontab('0 */35 * * * *', function(){
|
||||
// $email = new EmailsUtils();
|
||||
// $email->details();
|
||||
// });
|
||||
|
||||
// // 邮件处理
|
||||
// new Crontab('0 */40 * * * *', function(){
|
||||
// $email = new EmailsUtils();
|
||||
// $email->process();
|
||||
// });
|
||||
|
||||
if (getenv('ENVIRONMENT') === 'master') {
|
||||
// 拉取新邮件 - 每小时的第20分钟0秒执行
|
||||
new Crontab('0 */20 * * * *', function(){
|
||||
$email = new EmailsUtils();
|
||||
$email->uids();
|
||||
});
|
||||
|
||||
// 邮件详情 - 每小时的第25分钟0秒执行
|
||||
new Crontab('0 */25 * * * *', function(){
|
||||
$email = new EmailsUtils();
|
||||
$email->details();
|
||||
});
|
||||
|
||||
// 邮件处理 - 每小时的第30分钟0秒执行
|
||||
new Crontab('0 */30 * * * *', function(){
|
||||
$email = new EmailsUtils();
|
||||
$email->process();
|
||||
});
|
||||
|
||||
// 邮件分派 - 每小时的第35分钟0秒执行
|
||||
new Crontab('0 */35 * * * *', function(){
|
||||
$email = new EmailsUtils();
|
||||
$email->fenpai();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user