Instead, if I set timeout in function, how can I check if that timeout it's ended and retry upload?