How to resolve rq multiple tasks h12 heroku timeout?How can I safely create a nested directory in Python?How do I check if a string is a number (float)?How to return multiple values from a function?How to get the current time in Pythonheroku - how to see all the logsHow does Python's super() work with multiple inheritance?How to empty a Heroku databaseHow to link a folder with an existing Heroku appEasy way to prevent Heroku idling?H12 timeout error on Heroku
Malformed Address '10.10.21.08/24', must be X.X.X.X/NN or
Paid for article while in US on F-1 visa?
Do other languages have an "irreversible aspect"?
Replacing matching entries in one column of a file by another column from a different file
Why can't we play rap on piano?
What does the "remote control" for a QF-4 look like?
Why doesn't H₄O²⁺ exist?
Languages that we cannot (dis)prove to be Context-Free
Is it possible to do 50 km distance without any previous training?
"You are your self first supporter", a more proper way to say it
Modeling an IP Address
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
How to format long polynomial?
What are these boxed doors outside store fronts in New York?
Do I have a twin with permutated remainders?
Can a Cauchy sequence converge for one metric while not converging for another?
Alternative to sending password over mail?
Could an aircraft fly or hover using only jets of compressed air?
How do I deal with an unproductive colleague in a small company?
What is the word for reserving something for yourself before others do?
Are the number of citations and number of published articles the most important criteria for a tenure promotion?
Cross compiling for RPi - error while loading shared libraries
Watching something be written to a file live with tail
When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?
How to resolve rq multiple tasks h12 heroku timeout?
How can I safely create a nested directory in Python?How do I check if a string is a number (float)?How to return multiple values from a function?How to get the current time in Pythonheroku - how to see all the logsHow does Python's super() work with multiple inheritance?How to empty a Heroku databaseHow to link a folder with an existing Heroku appEasy way to prevent Heroku idling?H12 timeout error on Heroku
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to run a heroku flask python application with redis. However, I am facing the following error:
at=error code=H12 desc="Request timeout" method=POST path="/uploaderlocal" host=a2n.herokuapp.com dyno=web.1 connect=1ms service=31890ms status=503 bytes=0 protocol=https
The heroku web page crashes with the above error(due to a timeout), but the background processes will continue to run. Is there any possible way to stall the heroku web page until the tasks in the redis background queue have finished? Below is my code for your reference. Note that I am trying to finish multiple redis queued tasks before I return the results.html template.
from rq import Queue
from worker import conn
from rq.job import Job
app = Flask(__name__)
q = Queue(connection=conn)
job1 = q.enqueue_call(func=method1(), args=(), timeout='1h')
job2 = q.enqueue_call(func=method2(), args=(), timeout='1h')
job3 = q.enqueue_call(func=method3(), args=(), timeout='1h')
job4 = q.enqueue_call(func=method4(), args=(), timeout='1h')
the below code attempts (but fails) to stall the return of the #html template before the processes are finished
while(len(q)>0):
time.sleep(1)
return render_template('result.html')
Thank you for your help in advance.
python heroku flask redis
add a comment |
I am trying to run a heroku flask python application with redis. However, I am facing the following error:
at=error code=H12 desc="Request timeout" method=POST path="/uploaderlocal" host=a2n.herokuapp.com dyno=web.1 connect=1ms service=31890ms status=503 bytes=0 protocol=https
The heroku web page crashes with the above error(due to a timeout), but the background processes will continue to run. Is there any possible way to stall the heroku web page until the tasks in the redis background queue have finished? Below is my code for your reference. Note that I am trying to finish multiple redis queued tasks before I return the results.html template.
from rq import Queue
from worker import conn
from rq.job import Job
app = Flask(__name__)
q = Queue(connection=conn)
job1 = q.enqueue_call(func=method1(), args=(), timeout='1h')
job2 = q.enqueue_call(func=method2(), args=(), timeout='1h')
job3 = q.enqueue_call(func=method3(), args=(), timeout='1h')
job4 = q.enqueue_call(func=method4(), args=(), timeout='1h')
the below code attempts (but fails) to stall the return of the #html template before the processes are finished
while(len(q)>0):
time.sleep(1)
return render_template('result.html')
Thank you for your help in advance.
python heroku flask redis
I just wanted to clarify my question. I am asking if there is a way to check when the redis queue tasks have successfully completed so that I can appropriately proceed once all of the queued tasks are finished.
– Arjun Akkiraju
Mar 8 at 1:55
add a comment |
I am trying to run a heroku flask python application with redis. However, I am facing the following error:
at=error code=H12 desc="Request timeout" method=POST path="/uploaderlocal" host=a2n.herokuapp.com dyno=web.1 connect=1ms service=31890ms status=503 bytes=0 protocol=https
The heroku web page crashes with the above error(due to a timeout), but the background processes will continue to run. Is there any possible way to stall the heroku web page until the tasks in the redis background queue have finished? Below is my code for your reference. Note that I am trying to finish multiple redis queued tasks before I return the results.html template.
from rq import Queue
from worker import conn
from rq.job import Job
app = Flask(__name__)
q = Queue(connection=conn)
job1 = q.enqueue_call(func=method1(), args=(), timeout='1h')
job2 = q.enqueue_call(func=method2(), args=(), timeout='1h')
job3 = q.enqueue_call(func=method3(), args=(), timeout='1h')
job4 = q.enqueue_call(func=method4(), args=(), timeout='1h')
the below code attempts (but fails) to stall the return of the #html template before the processes are finished
while(len(q)>0):
time.sleep(1)
return render_template('result.html')
Thank you for your help in advance.
python heroku flask redis
I am trying to run a heroku flask python application with redis. However, I am facing the following error:
at=error code=H12 desc="Request timeout" method=POST path="/uploaderlocal" host=a2n.herokuapp.com dyno=web.1 connect=1ms service=31890ms status=503 bytes=0 protocol=https
The heroku web page crashes with the above error(due to a timeout), but the background processes will continue to run. Is there any possible way to stall the heroku web page until the tasks in the redis background queue have finished? Below is my code for your reference. Note that I am trying to finish multiple redis queued tasks before I return the results.html template.
from rq import Queue
from worker import conn
from rq.job import Job
app = Flask(__name__)
q = Queue(connection=conn)
job1 = q.enqueue_call(func=method1(), args=(), timeout='1h')
job2 = q.enqueue_call(func=method2(), args=(), timeout='1h')
job3 = q.enqueue_call(func=method3(), args=(), timeout='1h')
job4 = q.enqueue_call(func=method4(), args=(), timeout='1h')
the below code attempts (but fails) to stall the return of the #html template before the processes are finished
while(len(q)>0):
time.sleep(1)
return render_template('result.html')
Thank you for your help in advance.
python heroku flask redis
python heroku flask redis
asked Mar 8 at 1:54
Arjun AkkirajuArjun Akkiraju
11
11
I just wanted to clarify my question. I am asking if there is a way to check when the redis queue tasks have successfully completed so that I can appropriately proceed once all of the queued tasks are finished.
– Arjun Akkiraju
Mar 8 at 1:55
add a comment |
I just wanted to clarify my question. I am asking if there is a way to check when the redis queue tasks have successfully completed so that I can appropriately proceed once all of the queued tasks are finished.
– Arjun Akkiraju
Mar 8 at 1:55
I just wanted to clarify my question. I am asking if there is a way to check when the redis queue tasks have successfully completed so that I can appropriately proceed once all of the queued tasks are finished.
– Arjun Akkiraju
Mar 8 at 1:55
I just wanted to clarify my question. I am asking if there is a way to check when the redis queue tasks have successfully completed so that I can appropriately proceed once all of the queued tasks are finished.
– Arjun Akkiraju
Mar 8 at 1:55
add a comment |
1 Answer
1
active
oldest
votes
I think you must have some spaces in front of the time.sleep(1) command?
The value of the variable q will not change at any time inside the while loop. Therefore it will permanently sleep, or exit straight out.
You need to re-evaluate q in the while loop, possibly as follows:
while True:
time.sleep(1)
q = Queue(connection=conn)
if len(q) == 0:
break
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055642%2fhow-to-resolve-rq-multiple-tasks-h12-heroku-timeout%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you must have some spaces in front of the time.sleep(1) command?
The value of the variable q will not change at any time inside the while loop. Therefore it will permanently sleep, or exit straight out.
You need to re-evaluate q in the while loop, possibly as follows:
while True:
time.sleep(1)
q = Queue(connection=conn)
if len(q) == 0:
break
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
add a comment |
I think you must have some spaces in front of the time.sleep(1) command?
The value of the variable q will not change at any time inside the while loop. Therefore it will permanently sleep, or exit straight out.
You need to re-evaluate q in the while loop, possibly as follows:
while True:
time.sleep(1)
q = Queue(connection=conn)
if len(q) == 0:
break
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
add a comment |
I think you must have some spaces in front of the time.sleep(1) command?
The value of the variable q will not change at any time inside the while loop. Therefore it will permanently sleep, or exit straight out.
You need to re-evaluate q in the while loop, possibly as follows:
while True:
time.sleep(1)
q = Queue(connection=conn)
if len(q) == 0:
break
I think you must have some spaces in front of the time.sleep(1) command?
The value of the variable q will not change at any time inside the while loop. Therefore it will permanently sleep, or exit straight out.
You need to re-evaluate q in the while loop, possibly as follows:
while True:
time.sleep(1)
q = Queue(connection=conn)
if len(q) == 0:
break
answered Mar 8 at 20:35
Merv ColtonMerv Colton
113
113
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
add a comment |
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
According to python-rq.org/docs You are checking the length of the q correctly, but you are checking in the wrong place in your program. You are checking the length before you add anything to the q, so the value of q in your code will always be zero.
– Merv Colton
Mar 9 at 9:20
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055642%2fhow-to-resolve-rq-multiple-tasks-h12-heroku-timeout%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I just wanted to clarify my question. I am asking if there is a way to check when the redis queue tasks have successfully completed so that I can appropriately proceed once all of the queued tasks are finished.
– Arjun Akkiraju
Mar 8 at 1:55