modify the code to make the project can update data to db in the set time interval