Skip to content

Commit 4bd4129

Browse files
committed
Fix: remove cached db settings to ensure they properly upgraded
1 parent c2dc582 commit 4bd4129

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

server.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
StartUpFixes::fix();
8686
foreach ($sessions as $session) {
8787
StartUpFixes::removeBrokenIpc($session);
88+
StartUpFixes::removeOldSettings($session);
8889
}
8990
new TelegramApiServer\Server\Server(
9091
$options,

src/Migrations/StartUpFixes.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@ public static function removeBrokenIpc(string $session): void
2020
unlink($file);
2121
}
2222
}
23+
24+
public static function removeOldSettings(string $session): void
25+
{
26+
info('Removing old settings file to fix startup if db settings changed' . PHP_EOL);
27+
foreach (glob(ROOT_DIR . "/$session/safe.php*") as $file) {
28+
info("removing: $file");
29+
unlink($file);
30+
}
31+
}
2332
}

0 commit comments

Comments
 (0)