The shared link doesn’t get deleted until
- the link is “un-shared”
- the shared file is deleted and removed from the trash bin
However, when one of the above is given, it cannot be reused immediately, but you have to wait for the next tick of the cron job. Cron via AJAX or web cron might not be sufficient here.