Skip to content

Commit b80b6ee

Browse files
committed
fix: purge expired notifications at initialization
1 parent 99a766c commit b80b6ee

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/DIRAC/FrameworkSystem/Service/NotificationHandler.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from DIRAC.Core.Security import Properties
1919
from DIRAC.Core.Utilities.DictCache import DictCache
2020
from DIRAC.Core.Utilities.Mail import Mail
21-
from DIRAC.Core.Utilities.ThreadScheduler import gThreadScheduler
2221
from DIRAC.FrameworkSystem.DB.NotificationDB import NotificationDB
2322

2423

@@ -30,10 +29,6 @@ def initializeHandler(cls, serviceInfo):
3029
cls.mailCache = DictCache()
3130
cls.notDB = NotificationDB()
3231

33-
## FIXME: move to an agent
34-
gThreadScheduler.addPeriodicTask(3600, cls.notDB.purgeExpiredNotifications)
35-
##
36-
3732
return S_OK()
3833

3934
def initialize(self):
@@ -43,6 +38,8 @@ def initialize(self):
4338
self.clientProperties = credDict["properties"]
4439
self.client = credDict["username"]
4540

41+
self.notDB.purgeExpiredNotifications()
42+
4643
###########################################################################
4744
types_sendMail = [str, str, str, str]
4845

0 commit comments

Comments
 (0)