Open josecelano opened 6 months ago
Reminder: check if we need to create and drop the weak pointer (weak_tracker_statistics_importer.upgrade
). Maybe we can always use the same because now it's executed more often. In the first implementation it was supposed to be used only every hours for some minutes, so I made sense to create it and drop it.
There is a background task to import torrent stats form the tracker using the tracker REST API. The Index imports a number of seeders and leechers for all torrents in the Index (all torrents in the Index are also in the Tracker, but not all torrents in the Tracker are in the Index).
Old solution
Pros:
Cons:
Current solution
I changed the old solution adding an
updated_at
field to the stats records.Pros:
Cons
NOTICE: we wait 2 seconds between importations because if there is nothing to import, the CPU is constantly running queries against the database to get the updated list of torrents pending import.
Newly proposed solution
NOTICE: we wait only when there is nothing to import. Instead of continuously checking if there is more job to do, we only check every 2 seconds (config value). However, when there are torrents to update, we don't stop updating them.
Pros:
Cons
cc @da2ce7