mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
fix: use wasChanged() instead of isDirty() in updated hook
Critical Bug Fix: - isDirty() always returns false in the updated() hook - Changes are already persisted when updated() runs - wasChanged() correctly tracks what was modified during save Affected Code: - helper_version check: Now properly triggers PullHelperImageJob - fqdn check: Now properly clears TrustHosts cache Impact: ✅ Cache invalidation now works when FQDN changes ✅ Helper image updates now trigger correctly ✅ Security fix cache is properly cleared on config changes This also fixes an existing bug where helper_version updates never triggered the PullHelperImageJob dispatch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ class InstanceSettings extends Model
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::updated(function ($settings) {
|
||||
if ($settings->isDirty('helper_version')) {
|
||||
if ($settings->wasChanged('helper_version')) {
|
||||
Server::chunkById(100, function ($servers) {
|
||||
foreach ($servers as $server) {
|
||||
PullHelperImageJob::dispatch($server);
|
||||
@@ -44,7 +44,7 @@ class InstanceSettings extends Model
|
||||
}
|
||||
|
||||
// Clear trusted hosts cache when FQDN changes
|
||||
if ($settings->isDirty('fqdn')) {
|
||||
if ($settings->wasChanged('fqdn')) {
|
||||
\Cache::forget('instance_settings_fqdn_host');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user