mirror of
https://github.com/safing/portbase
synced 2025-09-10 15:34:26 +00:00
Use workers for module failure mirroring and fix mirror looping
This commit is contained in:
parent
5c87029991
commit
ae13d87aed
2 changed files with 13 additions and 5 deletions
|
@ -70,7 +70,13 @@ func mirrorModuleStatus(moduleFailure uint8, id, title, msg string) {
|
|||
// The notification already exists.
|
||||
|
||||
// Check if we should delete it.
|
||||
if moduleFailure == modules.FailureNone {
|
||||
if moduleFailure == modules.FailureNone && !n.Meta().IsDeleted() {
|
||||
|
||||
// Remove belongsTo, as the deletion was already triggered by the module itself.
|
||||
n.Lock()
|
||||
n.belongsTo = nil
|
||||
n.Unlock()
|
||||
|
||||
n.Delete()
|
||||
}
|
||||
|
||||
|
@ -92,6 +98,8 @@ func mirrorModuleStatus(moduleFailure uint8, id, title, msg string) {
|
|||
}
|
||||
|
||||
switch moduleFailure {
|
||||
case modules.FailureNone:
|
||||
return
|
||||
case modules.FailureHint:
|
||||
n.Type = Info
|
||||
n.AvailableActions = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue