mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Started adding support for "local files" logs to be also stored on DB
This commit is contained in:
parent
6db9b4d75d
commit
da7a5e22e3
@ -93,6 +93,7 @@ class LogManager(metaclass=singleton.Singleton):
|
||||
message: str,
|
||||
source: str,
|
||||
avoidDuplicates: bool,
|
||||
keepLogSize: bool = True,
|
||||
):
|
||||
"""
|
||||
Logs a message associated to owner
|
||||
@ -102,7 +103,7 @@ class LogManager(metaclass=singleton.Singleton):
|
||||
|
||||
qs = models.Log.objects.filter(owner_id=owner_id, owner_type=owner_type)
|
||||
# First, ensure we do not have more than requested logs, and we can put one more log item
|
||||
if qs.count() >= GlobalConfig.MAX_LOGS_PER_ELEMENT.getInt():
|
||||
if keepLogSize and qs.count() >= GlobalConfig.MAX_LOGS_PER_ELEMENT.getInt():
|
||||
for i in qs.order_by(
|
||||
'-created',
|
||||
)[GlobalConfig.MAX_LOGS_PER_ELEMENT.getInt() - 1 :]:
|
||||
|
@ -75,7 +75,6 @@ class MessageProcessorThread(BaseThread):
|
||||
|
||||
def run(self):
|
||||
while self.keepRunning:
|
||||
|
||||
# Locate all notifications from "persistent" and try to process them
|
||||
# If no notification can be fully resolved, it will be kept in the database
|
||||
for n in Notification.getPersistentQuerySet().all():
|
||||
|
Loading…
Reference in New Issue
Block a user