This PR replaces the usage of a class variable in BackgroundJob.
That class variable causes problems when using the async mode because fibers can modify it while others still need to read it. Luckily, with the current code, the only attribute affected is "enqueue_time", which is not accurate anyway (see https://github.com/3scale/apisonator/issues/18).
Even without taking the async mode into consideration using a class var is counter-intuitive. The arguments of a particular job (service ID, app ID, etc.) should belong to an instance, they shouldn't be stored in a class var.
This PR replaces the usage of a class variable in
BackgroundJob
.That class variable causes problems when using the async mode because fibers can modify it while others still need to read it. Luckily, with the current code, the only attribute affected is "enqueue_time", which is not accurate anyway (see https://github.com/3scale/apisonator/issues/18).
Even without taking the async mode into consideration using a class var is counter-intuitive. The arguments of a particular job (service ID, app ID, etc.) should belong to an instance, they shouldn't be stored in a class var.