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;








-1















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.










share|improve this question






















  • 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

















-1















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.










share|improve this question






















  • 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













-1












-1








-1








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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • 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












1 Answer
1






active

oldest

votes


















0














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





share|improve this answer























  • 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











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
);



);













draft saved

draft discarded


















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









0














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





share|improve this answer























  • 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















0














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





share|improve this answer























  • 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













0












0








0







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





share|improve this answer













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






share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Алба-Юлія

Захаров Федір Захарович