Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6833489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:59:05+00:00 2026-05-26T22:59:05+00:00

Hi I am working on an application in Django. I have multiple threads running

  • 0

Hi I am working on an application in Django. I have multiple threads running and I need to check the status of the threads periodically. So I used setInterval() but I want to stop it when I have exception in thread. But it is not stopping and keeps on calling the URL. Here is my code:

function checkThreadsStatus(){
   var g_progress_intv = setInterval(function() {
       $.post("some_url", function(json_response) {
           var jsonObj = eval("(" + (json_response) + ")");
           if (jsonObj.exceptionOccur){
               clearInterval(g_progress_intv);
               g_progress_intv = 0;
           }
           else{
               //do some stuff
           }
           });
    }, 2000);
 }

jsonObj.exceptionOccur is a boolean variable. But when it is True setInterval() does not Stop.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:59:06+00:00Added an answer on May 26, 2026 at 10:59 pm

    Are you calling the checkThreadsStatus() function multiple times? The intervals might possibly be stopping, but you are declaring them on top of each other. Use some alerts or console.log in there to determine the actual state of the variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed an application using Django and everything is working fine but I
I'm working on a blog application in Django. Naturally, I have models set up
I'm running CentOS 5, and am trying to get a django application working with
I have been working on an application in Django. To begin with, for simplicity,
I have a Django application running locally and I'd like to test the send_mail()
I have a new Django application I am working on. I have the following
I am working on a Django application where I need all the postgres represented
so I'm working on a django application where I have a model Event. Each
In a django application I am working on, I have just added the ability
I'm working through the design of a Django inventory tracking application, and have hit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.