in provider/database.py [0:0]
def disableTrigger(self, triggerFQN, status_code, message='Automatically disabled after receiving a {} status code when firing the trigger.'):
try:
document = self.database[triggerFQN]
if document.exists():
logging.info('Found trigger to disable from DB: {}'.format(triggerFQN))
status = {
'active': False,
'dateChanged': long(time.time() * 1000),
'reason': {
'kind': 'AUTO',
'statusCode': status_code,
'message': message.format(status_code)
}
}
document['status'] = status
document.save()
logging.info('{} Successfully recorded trigger as disabled.'.format(triggerFQN))
except Exception as e:
logging.error('[{}] Uncaught exception while disabling trigger: {}'.format(triggerFQN, e))