--- a/hooks-queue.py Thu Jul 21 23:35:01 2016 +0800
+++ b/hooks-queue.py Thu Jul 21 23:38:15 2016 +0800
return self.application.rconn
+ def push(self, base, hashes):
+ data = json.dumps(item)
+ logging.debug('Pushing %s', data)
+ self.rconn.rpush('candolint:queue:changes', data)
+ logging.info('Pushed a change for %s', item['repo'])
+ self.finish({'result': 'OK', 'queued': len(hashes)})
class BitbucketHookHandler(BaseHookHandler):
hashes.add(change['new']['target']['hash'])
- data = json.dumps(item)
- logging.debug('Pushing %s', data)
- self.rconn.rpush('candolint:queue:changes', data)
- logging.info('Pushed a change for %s', item['repo'])
- self.finish({'result': 'OK', 'queued': len(hashes)})
+ self.push(base, hashes)
class CandolintHooks(Application):