作者 邓超

1

... ... @@ -61,21 +61,10 @@ function start(){
});
// 需要更新同步的邮件
//todo:: 需要更新同步的邮件,每10分钟同步一次,这里是的时间是微妙
\Swoole\Timer::tick(600000,function (){
$id = 0;
while (true){
$ids = db()->all('select `id` from `'.\Model\emailSql::$table.'` where `id` > '.$id.' order by `id` asc limit 1000 offset 0');
if(!$ids){
break;
}
foreach ($ids as $v){
$id = $v['id'];
redis()->rPush('sync_email_lists', $v['id']);
}
}
start_now_mail();
});
... ...
... ... @@ -107,6 +107,14 @@ class Home {
}
/**
* 邮箱文件夹
* @author:dc
* @time 2023/2/18 10:58
*/
public function folder(){
}
... ...
... ... @@ -240,6 +240,33 @@ function list_to_tree($list, $pk='id',$pid = 'pid',$child = '_child',$root=0,$em
}
/**
* todo:: 立即开始同步邮件,非必要请不要手动调用,,系统有定时调用,
* @author:dc
* @time 2023/2/18 11:04
*/
function start_now_mail(){
$id = 0;
while (true){
$ids = db()->all('select `id` from `'.\Model\emailSql::$table.'` where `id` > '.$id.' order by `id` asc limit 1000 offset 0');
if(!$ids){
break;
}
foreach ($ids as $v){
$id = $v['id'];
redis()->rPush('sync_email_lists', $v['id']);
}
}
}
... ...
... ... @@ -11,4 +11,7 @@ return [
/** 邮件列表 @see Home::lists() **/
'mail/list' => [Home::class,'lists'],
/** 邮件文件夹 @see Home::folder() **/
'mail/folder' => [Home::class,'folder'],
];
\ No newline at end of file
... ...