libs3 icon indicating copy to clipboard operation
libs3 copied to clipboard

doult of function should_retry

Open Scott1989 opened this issue 9 years ago • 1 comments

I read source code of function should_retry:

`static int should_retry() { if (retriesG--) { // Sleep before next retry; start out with a 1 second sleep static int retrySleepInterval = 1 * SLEEP_UNITS_PER_SECOND; sleep(retrySleepInterval); // Next sleep 1 second longer retrySleepInterval++; return 1; }

return 0;

}` in once loop, var retrySleepInerval is reassigned, can retrySleepInterval++ be effective?

Scott1989 avatar Feb 19 '16 08:02 Scott1989

retrySleepInterval is a static, so it is only assigned once. I admit that this is not the most beautiful or easiest to understand code.

bji avatar Feb 19 '16 08:02 bji