mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 06:04:21 +01:00
teos - Changes the behavior for updates of already triggered appointments
If an update for an already triggered appointment is received, it will be drop no matter if the locator is in the cache or not. This tries to prevent inconsistencies between the Watcher and the Responder, specially in the case of a reorg when data may have to flow backwards.
This commit is contained in:
@@ -200,17 +200,17 @@ class Watcher:
|
||||
# If an appointment is requested by the user the uuid can be recomputed and queried straightaway (no maps).
|
||||
uuid = hash_160("{}{}".format(appointment.locator, user_id))
|
||||
|
||||
# If this is a copy of an appointment we've already reacted to, the new appointment is rejected.
|
||||
if uuid in self.responder.trackers:
|
||||
message = "Appointment already in Responder"
|
||||
logger.info(message)
|
||||
raise AppointmentAlreadyTriggered(message)
|
||||
|
||||
# Add the appointment to the Gatekeeper
|
||||
available_slots = self.gatekeeper.add_update_appointment(user_id, uuid, appointment)
|
||||
|
||||
# Appointments that were triggered in blocks hold in the cache
|
||||
if appointment.locator in self.locator_cache.cache:
|
||||
# If this is a copy of an appointment we've already reacted to, the new appointment is rejected.
|
||||
if uuid in self.responder.trackers:
|
||||
message = "Appointment already in Responder"
|
||||
logger.info(message)
|
||||
raise AppointmentAlreadyTriggered(message)
|
||||
|
||||
try:
|
||||
breach = self.check_breach(uuid, appointment, self.locator_cache.cache[appointment.locator])
|
||||
receipt = self.responder.handle_breach(
|
||||
|
||||
Reference in New Issue
Block a user