Fix various bugs in the event system
Squash many bugs in the event notification system and simplify the code.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from datetime import datetime
|
||||
from csiphash import siphash24
|
||||
from copy import deepcopy
|
||||
from json import dumps
|
||||
import main
|
||||
from utils.logging.debug import debug
|
||||
|
||||
def dedup(numName, c):
|
||||
# deduplication
|
||||
def dedup(numName, b):
|
||||
c = deepcopy(b)
|
||||
del c["time"]
|
||||
c["approxtime"] = str(datetime.utcnow().timestamp())[:main.config["Tweaks"]["DedupPrecision"]]
|
||||
castHash = siphash24(main.hashKey, dumps(c, sort_keys=True).encode("utf-8"))
|
||||
del c["approxtime"]
|
||||
|
||||
Reference in New Issue
Block a user