Skip to content
Permalink
Browse files

Add an id to the patch events dataset

This id is an incrementing counter, so patch feed readers can
easily know when the chain is broken.
  • Loading branch information...
cvaroqui committed Jul 14, 2019
1 parent 618adb5 commit 7bb7eff5f2199c78326a5ab89d146b149840c061
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/osvcd_shared.py
@@ -30,6 +30,7 @@
# daemon_status cache
LAST_DAEMON_STATUS = {}
DAEMON_STATUS = {}
PATCH_ID = 0

# disable orchestration if a peer announces a different compat version than
# ours
@@ -1377,6 +1378,7 @@ def update_daemon_status(self):
global LAST_DAEMON_STATUS
global DAEMON_STATUS
global EVENT_Q
global PATCH_ID
LAST_DAEMON_STATUS = json.loads(json.dumps(DAEMON_STATUS))
DAEMON_STATUS = self._daemon_status()
diff = json_delta.diff(
@@ -1385,8 +1387,10 @@ def update_daemon_status(self):
)
if not diff:
return
PATCH_ID += 1
EVENT_Q.put({
"kind": "patch",
"id": PATCH_ID,
"ts": time.time(),
"data": diff,
})

0 comments on commit 7bb7eff

Please sign in to comment.
You can’t perform that action at this time.