add factory method

This commit is contained in:
Alex Holliday committed 2025-06-08 09:01:30 +08:00
1 parent 8de2c0387c
commit afbd1157c0
2 files changed
+12 -2

No files matched your search

+6 -1
View File
@@ -10,7 +10,12 @@ class PulseQueue {
this.appSettings = appSettings;
this.pulseQueueHelper = pulseQueueHelper;
this.logger = logger;
this.init();
}
static async create({ appSettings, db, pulseQueueHelper, logger }) {
const instance = new PulseQueue({ appSettings, db, pulseQueueHelper, logger });
await instance.init();
return instance;
}
// ****************************************