改进 队列

This commit is contained in:
iVampireSP.com 2023-02-06 19:29:14 +08:00
parent 385c6596f0
commit f60cc898c1
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 6 additions and 2 deletions

View File

@ -1,10 +1,14 @@
# LaeCloud 莱云
### 扣费队列
1. default 默认扣费队列
2. host-cost 机器扣费队列
### 主节点运行
```bash
docker run -itd --name=lae_schedule --init --restart=always --net=host -v /opt/lae:/opt/lae ccr.ccs.tencentyun.com/laecloud/cafe:latte art schedule:work
docker run -itd --name=lae_workers --init --restart=always --net=host -v /opt/lae:/opt/lae ccr.ccs.tencentyun.com/laecloud/cafe:latte art queue:work
docker run -itd --name=lae_workers --init --restart=always --net=host -v /opt/lae:/opt/lae ccr.ccs.tencentyun.com/laecloud/cafe:latte art queue:work --queue=default,host-cost
```
### Web 节点运行

View File

@ -40,7 +40,7 @@ public function handle(): void
$host->whereIn('status', ['running', 'stopped'])->with('user')->chunk(500, function ($hosts) {
foreach ($hosts as $host) {
dispatch(new RealHostCostJob($host, $host->getPrice()));
dispatch(new RealHostCostJob($host, $host->getPrice()))->onQueue('host-cost');
}
});
}