-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
python script does not run with sleep in loop #821
Comments
How are you running the python script? |
Hey. Sorry, forgot to mention. I start the script with |
It should work without the interpreter option (since 7d3bd3f) Try directly with There's already a test for an infinite loop in python in this commit : https://github.com/Unitech/PM2/blob/7d3bd3fabeabcfdf5c8b754f3f863c2cb1b01d46/test/fixtures/binary-py-file.py I am trying to reproduce your bug but it works fine here. |
My ...
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
[test.py-0 (out)] <built-in function sleep>
[test.py-0 (out)] bar
... % pm2 --version
0.12.1
% python --version
Python 2.7.6 |
Hey,
and there are no print statements.
Gonna try to upgrade to new version of |
Tried with pm2 12.1 - still no changes. Logs are empty.
|
So i came back and turned logs back on - seems that the script is actually working, but the logs are really lagging. After I start the script the logs are empty for quite few minutes and the |
Might be #822 (comment) related? |
Could be. I ll keep an eye on it. |
Closing for now ;) |
Hey,
I am trying to run a python script under pm2. It would be like cron but would run more often.
The problem is that for some reason if there is a sleep in while loop, or for loop - script does not even start. if I comment the
time.sleep(1)
- script runs fine:If I run script regulary with
# python test.py
the sleep works as intended.Any ideas ?
The text was updated successfully, but these errors were encountered: