Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Coldstart delay #6

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Fix: Coldstart delay #6

wants to merge 1 commit into from

Conversation

Meldiron
Copy link
Contributor

@Meldiron Meldiron commented Nov 9, 2022

There is a lot of delay because of sleep we do in multiple places. This PR is supposed to find better ways of doing these repetitive checks in order to speed up the process.

throw new Exception('Runtime failed to launch in allocated time.', 500);
}

\sleep(1);
\sleep(0.1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\sleep(0.1);
\usleep(100000);

Use usleep if you want to sleep for less than a second. usleep uses microseconds instead, so sleeping for 100000 microseconds is equivalent to sleeping 0.1 seconds.

This also solves the CodeQL failure.

throw new Exception('An internal curl error has occurred within the executor! Error Msg: ' . $error, 500);
}

\sleep(1);
\sleep(0.1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\sleep(0.1);
\usleep(100000);

Same here, use usleep instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants