mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
fix(system): avoid creating multiple worker job queue
We created miltiple worker job queue because the bean was in the prototype scope. This was needed only for tests as they are closing it. Switching to singleton and rebuilding the context of the test that needs it fixes the issue.
This commit is contained in:
@@ -42,7 +42,7 @@ public class H2QueueFactory implements QueueFactoryInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Prototype // must be prototype so we can create two Worker in the same application context for testing purpose.
|
||||
@Singleton
|
||||
@Named(QueueFactoryInterface.WORKERJOB_NAMED)
|
||||
@Bean(preDestroy = "close")
|
||||
public QueueInterface<WorkerJob> workerJob() {
|
||||
|
||||
Reference in New Issue
Block a user