mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-13 02:54:27 +00:00
bulk insert logs for performance improvement
This commit is contained in:
parent
c669aeff27
commit
34800463fd
@ -240,5 +240,8 @@ class DBHandler(logging.Handler):
|
|||||||
"spiff_step": spiff_step,
|
"spiff_step": spiff_step,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if len(self.logs) % 1 == 0:
|
# so at some point we are going to insert logs.
|
||||||
|
# we don't want to insert on every log, so we will insert every 100 logs, which is just about as fast as inserting
|
||||||
|
# on every 1,000 logs. if we get deadlocks in the database, this can be changed to 1 in order to insert on every log.
|
||||||
|
if len(self.logs) % 100 == 0:
|
||||||
self.bulk_insert_logs()
|
self.bulk_insert_logs()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user