@unchainedshop/plugins
Version:
Because of a Typescript issue with upstream "postfinancecheckout", the Postfinance plugin has been disabled from transpilation, import the source ts files from src and enable node_module tsc or copy over the src/payment/postfinance-checkout to your projec
33 lines • 866 B
JavaScript
import { WorkerAdapter, WorkerDirector } from '@unchainedshop/core';
const wait = async (time) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
const Heartbeat = {
...WorkerAdapter,
key: 'shop.unchained.worker-plugin.heartbeat',
label: 'Heartbeat plugin to check if workers are working',
version: '1.0.0',
type: 'HEARTBEAT',
maxParallelAllocations: 1,
doWork: async (input) => {
if (input?.wait) {
await wait(input.wait);
}
if (input?.fails) {
return {
success: false,
result: input,
};
}
return {
success: true,
result: input,
};
},
};
WorkerDirector.registerAdapter(Heartbeat);
//# sourceMappingURL=heartbeat.js.map