Readme à jour, et quelques modifications sur les noms de variables.
This commit is contained in:
parent
f228493399
commit
4bc4cb7abe
8 changed files with 152 additions and 102 deletions
|
@ -261,13 +261,13 @@ def event(ob_id, before, after, more):
|
|||
|
||||
# Compute the whole list of messages. This returns a list of 2-tuples. We remove None messages, which
|
||||
# should not occcur... But, whatever.
|
||||
msgs_to_send = [msg for msg in [function(ob_id, (before, after), diff) for function in functions] if msg is not None]
|
||||
msgs_to_send = [msg for msg in [function(ob_id, (before, after), diff, more) for function in functions] if msg is not None]
|
||||
LOGGER.debug("[%r] in service event, messages are %r.", ob_id, msgs_to_send)
|
||||
|
||||
for msg in msgs_to_send:
|
||||
service_name, body, pos = msg[0], msg[1], msg[2]
|
||||
LOGGER.info("[%r] Adding %r on the EventTracker", ob_id, (pos, service_name, body))
|
||||
EventTracker.record_event_to_chain(ob_id, pos, service_name, body)
|
||||
service_name, operations, pos = msg[0], msg[1], msg[2]
|
||||
LOGGER.info("[%r] Adding %r on the EventTracker", ob_id, (pos, service_name, operations))
|
||||
EventTracker.record_event_to_chain(ob_id, pos, service_name, operations)
|
||||
|
||||
# Sends the first wave on the way.
|
||||
todo = EventTracker.get_off_record(ob_id)
|
||||
|
@ -276,8 +276,8 @@ def event(ob_id, before, after, more):
|
|||
# XXX - uncomment this when in production
|
||||
trigger_send(*msg)
|
||||
|
||||
def trigger_send(ob_id, routing_key, body):
|
||||
def trigger_send(ob_id, routing_key, operations):
|
||||
"""Sends a message via civet/trigger"""
|
||||
|
||||
body = tuple([ob_id] + [body])
|
||||
PRODUCER.send_message("trigger.%s" % (routing_key,), body)
|
||||
msg = tuple([ob_id] + [operations])
|
||||
PRODUCER.send_message("trigger.%s" % (routing_key,), msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue