mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 13:20:41 +00:00
Optimize PushServerUpdateJob performance with batch updates and async jobs
- Eager load service applications and databases to eliminate N+1 queries - Replace individual model updates with batch database updates for applications, previews, and services - Move connectProxyToNetworks to async ConnectProxyToNetworksJob to avoid blocking status updates - Optimize Server.databases() and applications() methods with efficient database queries - Use flatMap for cleaner collection transformations 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Jobs\ConnectProxyToNetworksJob;
|
||||
use App\Traits\HasSafeStringAttribute;
|
||||
|
||||
class StandaloneDocker extends BaseModel
|
||||
@@ -18,8 +19,7 @@ class StandaloneDocker extends BaseModel
|
||||
instant_remote_process([
|
||||
"docker network inspect $newStandaloneDocker->network >/dev/null 2>&1 || docker network create --driver overlay --attachable $newStandaloneDocker->network >/dev/null",
|
||||
], $server, false);
|
||||
$connectProxyToDockerNetworks = connectProxyToNetworks($server);
|
||||
instant_remote_process($connectProxyToDockerNetworks, $server, false);
|
||||
ConnectProxyToNetworksJob::dispatchSync($server);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user