Commit Graph

33 Commits

Author SHA1 Message Date
Raul Ochoa
189aff2aa9 Only log message on empty queue 2016-10-12 17:42:46 +02:00
Raul Ochoa
b86f82d3ca Batch.stop removes all listeners 2016-10-12 16:43:18 +02:00
Raul Ochoa
75fc21241f Locker TTL is configured 2016-10-12 13:11:20 +02:00
Raul Ochoa
98185e55cf Remove Job Queue Pool and use internal structure
- We don't need to create a different job queue per host.
- Batch locks on message instead of dequeue.
2016-10-12 12:26:50 +02:00
Raul Ochoa
22d8e48f53 Only lock on dequeue 2016-10-12 00:10:40 +02:00
Raul Ochoa
2822b68198 onJobHandler receives host with job
Queue seeker only returns hosts, not mixing responsibilities
2016-10-11 19:45:26 +02:00
Raul Ochoa
2c064041a1 Add dist lock to run all jobs by host in order
It uses http://redis.io/topics/distlock
Which is not perfect: http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html
2016-10-10 19:54:59 +02:00
Raul Ochoa
0de5d94617 Use debug with same params, no considering job status 2016-10-10 19:53:59 +02:00
Raul Ochoa
56a632347b Inject publisher 2016-10-10 19:47:50 +02:00
Raul Ochoa
66820a67bb Make possible to specify a name for batch 2016-10-10 19:46:07 +02:00
Daniel García Aubert
aa0ce62a85 Implement batch logger to log query times when queries are defined with id 2016-09-29 15:09:36 +02:00
Daniel García Aubert
0586f45413 Added callback to job subscriber to allow to batch service emit ready event 2016-07-22 13:47:14 +02:00
Daniel García Aubert
eb37fd305f Moved forever module 2016-05-18 11:55:58 +02:00
Daniel García Aubert
8b7d481b9a Avoided console usage, favor debug 2016-05-18 11:06:49 +02:00
Daniel García Aubert
cc7dd7a0d2 Job model refactor 2016-05-13 18:50:55 +02:00
Daniel García Aubert
4a83de09af Added job status enumerable to avoid hardcodes strings 2016-04-05 18:50:04 +02:00
Daniel García Aubert
da16f32789 Added uknown status to jobs when drain fails 2016-01-25 20:07:41 +01:00
Daniel García Aubert
e9bd93cf3f Now batch service is linked to express app in order to make it accesible from main app module to expose drain mechanism 2016-01-25 16:28:19 +01:00
Daniel García Aubert
1e49fbc33d Stopped batch service when draining 2016-01-25 15:32:00 +01:00
Daniel García Aubert
20fd536659 Now batch stop is synchronous, changed signature in test.
Fixed minor issue when draining the last job, queue is got before cancel the job.
2016-01-25 14:51:37 +01:00
Daniel García Aubert
c308551d05 Implemented drain to stop batch service gracefully.
Split job acceptance test
2016-01-13 16:25:25 +01:00
Daniel García Aubert
8d29e6b45c Improved log messages 2016-01-08 16:24:53 +01:00
Daniel García Aubert
20f00d58d9 Refactored batch service to avoid event noise, doing in callback way 2016-01-08 15:47:59 +01:00
Daniel García Aubert
f9f52d2bd1 Improved object creation in batch service 2016-01-08 11:32:01 +01:00
Daniel García Aubert
681772bf37 Implemented test for Job Controller and implemented batch stop service 2016-01-05 17:42:28 +01:00
Daniel García Aubert
534da04270 Improved job cancelation and fixed minor bugs 2015-12-31 17:01:06 +01:00
Daniel García Aubert
ef354bdb4d Improved queue consuption avoiding possible stack overflow 2015-12-31 12:33:11 +01:00
Daniel García Aubert
ada39d84b8 Implemented job cancelation in Batch API 2015-12-30 20:16:18 +01:00
Daniel García Aubert
8c42019641 Improved namespace in redis for batch's stuff 2015-12-29 15:46:04 +01:00
Daniel García Aubert
851c393f75 Refactored batch manager avoiding concurrence issues 2015-12-29 10:19:10 +01:00
Daniel García Aubert
ecb76ca1de Improved batch API being consistent with naming, humam readability for job dates, hide redis key details for jobs. 2015-12-23 17:29:11 +01:00
Daniel García Aubert
b16c0983c6 Implemented tests for batch API 2015-12-22 23:13:33 +01:00
Daniel García Aubert
3c23bf12e7 Fixed bug whether a job consumer is empty. And refactored batch module, now is a common object intead of module function 2015-12-22 20:12:10 +01:00