how to update the Multifeeder? #5

Closed
opened 3 years ago by mb · 4 comments
mb commented 3 years ago

Currently the Multifeeder updates its database at each restart of the Flask script ... Which is unhandy.

Updating the database at each API request will make the requests pretty slow, hmm.

Options:

  • an update button on the webpage? (not ideal)
  • an hourly automatic update? (cronjob restarting the supervisor service?)
Currently the Multifeeder updates its database at each restart of the Flask script ... Which is unhandy. Updating the database at each API request will make the requests pretty slow, hmm. Options: - an update button on the webpage? (not ideal) - an hourly automatic update? (cronjob restarting the supervisor service?)
mb commented 3 years ago
Poster

For now, i enabled a crontab that runs the following command every hour:

supervisortctl restart multifeeder

For now, i enabled a crontab that runs the following command every hour: `supervisortctl restart multifeeder`
Owner

I think you can use https://apscheduler.readthedocs.io/en/latest/
to periodically come back and execute feedtools.update()

This is the Flask implementation
https://github.com/viniciuschiele/flask-apscheduler
Because this is a different thread, it wont intervene with your requests or need to reboot the entire application every hour.

I think you can use https://apscheduler.readthedocs.io/en/latest/ to periodically come back and execute feedtools.update() This is the Flask implementation https://github.com/viniciuschiele/flask-apscheduler Because this is a different thread, it wont intervene with your requests or need to reboot the entire application every hour.
mb commented 3 years ago
Poster

That looks great!

Will try it out :)

That looks great! Will try it out :)
mb commented 3 years ago
Poster

It works great! The API is updated every 10 minutes now :).

It works great! The API is updated every 10 minutes now :).
mb closed this issue 3 years ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.