From 6deee0427c3e4934291b1103328d4c3d75d56e29 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Wed, 8 Mar 2017 18:45:47 +0100 Subject: Added heartbeat service. Add source. --- tools/merge_fetch.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/merge_fetch.py') diff --git a/tools/merge_fetch.py b/tools/merge_fetch.py index 2a2491d..b0b6ce6 100755 --- a/tools/merge_fetch.py +++ b/tools/merge_fetch.py @@ -24,8 +24,9 @@ def reportstatus(statusservers, own_key, target, variable, status): def do_reportstatus(node, baseurl, own_key, target, variable, status): try: + (ownname, _) = own_key result = http_request(baseurl + "plop/v1/status/merge_fetch", - json.dumps([{"target":target, "key": variable, "value": status}]), key=own_key, + json.dumps([{"source":ownname, "target":target, "key": variable, "value": status}]), key=own_key, verifynode=node) return json.loads(result) except requests.exceptions.HTTPError, e: @@ -79,7 +80,7 @@ def merge_fetch(args, config, localconfig, currentsizefile): new_entries -= certsinlog print >>sys.stderr, "adding", len(new_entries), "entries" sys.stderr.flush() - reportstatus(statusservers, own_key, "fetch", "total", len(certsinlog) + len(new_entries)) + reportstatus(statusservers, own_key, own_key[0], "total", len(certsinlog) + len(new_entries)) for ehash in new_entries: for storagenode in storagenodes: @@ -123,7 +124,7 @@ def merge_fetch(args, config, localconfig, currentsizefile): tree_size = len(logorder) currentsize = {"index": tree_size - 1, "hash": hexencode(logorder[tree_size-1])} write_file(currentsizefile, currentsize) - reportstatus(statusservers, own_key, "fetch", "fetched", tree_size) + reportstatus(statusservers, own_key, own_key[0], "fetched", tree_size) print >>sys.stderr, added_entries, sys.stderr.flush() print >>sys.stderr @@ -141,7 +142,7 @@ def merge_fetch(args, config, localconfig, currentsizefile): sys.stderr.flush() tree_size = len(logorder) - reportstatus(statusservers, own_key, "fetch", "fetched", tree_size) + reportstatus(statusservers, own_key, own_key[0], "fetched", tree_size) if tree_size == 0: return (0, '') else: -- cgit v1.1