diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-07-25 19:49:22 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-07-25 19:49:22 +0200 |
| commit | 878b06f38bb614cd35953fa368a2e42aafa17e9e (patch) | |
| tree | 305daba69328b71fbb02258f05d67418a50b3b95 | |
| parent | 275977b7fd848f9574930dbd8584b4f26a911660 (diff) | |
| download | processor-878b06f38bb614cd35953fa368a2e42aafa17e9e.tar.gz processor-878b06f38bb614cd35953fa368a2e42aafa17e9e.zip | |
abort early for empty batch
| -rw-r--r-- | worker.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -221,6 +221,10 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => { players: player_data.size, matches: match_data.size }); + if (msgs.size == 0) { + logger.info("nothing to do"); + return; + } // clean up to allow processor to accept while we wait for db clearTimeout(idle_timer); |
