1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-04-01 09:10:08 +02:00

🐛 Configuration files are reloaded gracefully

This commit is contained in:
2026-02-06 15:10:34 +01:00
parent b7a66d2d8f
commit 0ab56df954

View File

@@ -133,8 +133,11 @@ class PhpConfigurationFile: CreatedFromFile {
}
public func reload() {
let newLines = try! String(contentsOfFile: self.filePath)
.components(separatedBy: "\n")
guard let newLines = try? String(contentsOfFile: self.filePath)
.components(separatedBy: "\n") else {
Log.warn("Could not reload PHP configuration file at: `\(self.filePath)`")
return
}
// Update all properties atomically
lines = newLines