改进 使用 安全删除

This commit is contained in:
iVampireSP.com 2023-02-13 18:41:13 +08:00
parent 8a003f233c
commit 3999e61a20
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -47,12 +47,7 @@ public function destroy(HostRequest $request, Host $host): JsonResponse
} }
} }
// 如果时间大于 5 分钟,不满 1 小时 $host->safeDelete();
if (! $host->isCycle() && now()->diffInMinutes($host->updated_at) > 5 && now()->diffInMinutes($host->updated_at) < 60) {
$host->cost();
}
dispatch(new HostJob($host, 'delete'));
return $this->deleted($host); return $this->deleted($host);
} }