freesound-datasets icon indicating copy to clipboard operation
freesound-datasets copied to clipboard

refresh_sound_deleted_state command does not handle failed requests

Open xavierfav opened this issue 6 years ago • 0 comments

Currently we have a command that allows to check if sounds are deleted on Freesound, and update the database field in order to not show it to annotators.

The datasets refresh_sound_deleted_state command launches the task refresh_sound_deleted_state() from datasets/tasks.py. This command uses the Freesound API and does text search (query='') with filter on ID to retrieve pages of 50 sounds. If the request fails, it might assume that the sounds are deleted. The command should check the response type of the request, and maybe re-send the request, or just drop the command if after several tries.

I might be as simple as:

  • send request
  • check that response state is 200
    • if not, wait a second and re-send
    • after a few times, abandon the command (update field of the sounds that were detected as deleted before request started to fail)

xavierfav avatar Sep 10 '18 14:09 xavierfav