Skip to content

Commit 783fb70

Browse files
author
Alice
committed
fixed wait function
1 parent 66a85e0 commit 783fb70

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,11 @@ export default class StepFunctionsOfflinePlugin implements Plugin {
517517
// works with parameter: seconds, timestamp, timestampPath, secondsPath;
518518
return {
519519
waitState: true,
520-
f: event => {
520+
f: async event => {
521521
const waitTimer = this._waitState(event, currentState, stateName);
522522
this.cliLog(`Wait function ${stateName} - please wait ${waitTimer} seconds`);
523-
return (arg1, arg2, cb) => {
524-
setTimeout(() => {
525-
cb(null, event);
526-
}, waitTimer * 1000);
527-
};
523+
await delay(waitTimer);
524+
return (e, context, done) => done(null, e || event);
528525
},
529526
};
530527
}

0 commit comments

Comments
 (0)