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

  • SEARCH
  • Home
  • 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 8829657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:53:06+00:00 2026-06-14T07:53:06+00:00

I have a program query data from database (MySQL) every minute. while 1: self.alerteng.updateAndAnalyze()

  • 0

I have a program query data from database (MySQL) every minute.

while 1:
    self.alerteng.updateAndAnalyze()
    time.sleep(60)

but the data doesn’t change frequently; maybe once an hour or a day.(change by another C++ program)

I think the best way is track the change if a change happens then I query and update my data.

any advice?

  • 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-06-14T07:53:07+00:00Added an answer on June 14, 2026 at 7:53 am

    It depends what you’re doing, but SQLAlchemy’s Events functionality might help you out.

    It lets you run code whenever something happens in your database, i.e. after you insert a new row, or set a column value. I’ve used it in Flask apps to kick off notifications or other async processes.

    http://docs.sqlalchemy.org/en/rel_0_7/orm/events.html#mapper-events

    Here’s toy code from a Flask app that’ll run the kick_off_analysis() function whenever a new YourModel model is created in the database.

    from sqlalchemy import event
    
    @event.listens_for(YourModel, "after_insert")
    def kick_off_analysis(mapper, connection, your_model):
      # do stuff here
    

    Hope that helps you get started.

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

Sidebar

Related Questions

I have program use c and c++ language to access data from MySQL database.
The program have to download data from MySQL database. and fill the JList .
I have such GUI situation: Window1>vbox1>vbox2>scrolledvindow1>treeview1>treestore1. Program takes data from database through MySql C-api.
I have created a database application using java swing. My program retrieves data from
I have an MVC3 program in which I want to query a database and
I have written a query in Sql server 2008. select select * from program
I have created a database emailDatabase , its stored in C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA
I have inserted a lot of information into a SQlite database from my program.
I'm inserting data from oracle database to mysql database with php than insert and
I have some existing code that retrieves data from a database using ADO.NET that

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.