Skip to content

[Scripting] Sleep function only works when used with 'await' #556

@kics223w1

Description

@kics223w1

Description

The sleep function in the Scripting Tool only works when used with the await keyword.


Steps to Reproduce

async function onRequest(context, url, request) {
    console.log(url);

    // This line will NOT delay execution
    sleep(5000);

    return request;
}

Current Behavior

  • The sleep function only works correctly when prefixed with await.

Expected Behavior

  • The sleep function should work as intended even without the await prefix.

Environment

  • App Version: 3.4.0
  • OS: Windows / Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working✅ DoneTicket is resolved

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions