1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 16:58:51 -05:00

* fix retry{ ... } logic

This commit is contained in:
Reinhard Pointner 2012-12-02 09:32:33 +00:00
parent f053ecd8be
commit 55b4b26890

View File

@ -364,7 +364,7 @@ def tryQuietly(c) {
* Retry given closure until it returns successfully (indefinitely by default) * Retry given closure until it returns successfully (indefinitely by default)
*/ */
def retry(n = -1, quiet = false, c) { def retry(n = -1, quiet = false, c) {
for(int i = 1; i <= n; i++) { for(int i = 0; n < 0 || i <= n; i++) {
try { try {
return c.call() return c.call()
} catch(Throwable e) { } catch(Throwable e) {