how to update the Multifeeder? #5

Closed
opened 2021-02-22 18:57:28 +01:00 by mb · 4 comments

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?)
Author

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.
Author

That looks great!

Will try it out :)

That looks great! Will try it out :)
Author

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 2021-02-23 13:27:16 +01:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: varia/multifeeder#5
No description provided.