diff --git a/Tasks/CopyFilesV2/copyfiles.ts b/Tasks/CopyFilesV2/copyfiles.ts index a58b11d6d8f2..887ef5e838e1 100644 --- a/Tasks/CopyFilesV2/copyfiles.ts +++ b/Tasks/CopyFilesV2/copyfiles.ts @@ -45,13 +45,6 @@ async function main(): Promise { followSymbolicLinks: true }; - const retryOptions: RetryOptions = { - timeoutBetweenRetries: 1, - numberOfReties: 1 - }; - - const retryHelper = new RetryHelper(retryOptions); - tl.setResourcePath(path.join(__dirname, 'task.json')); // contents is a multiline input containing glob patterns @@ -72,6 +65,12 @@ async function main(): Promise { delayBetweenRetries = 0; } + const retryOptions: RetryOptions = { + timeoutBetweenRetries: delayBetweenRetries, + numberOfReties: retryCount + }; + const retryHelper = new RetryHelper(retryOptions); + const preserveTimestamp: boolean = tl.getBoolInput('preserveTimestamp', false); const ignoreMakeDirErrors: boolean = tl.getBoolInput('ignoreMakeDirErrors', false);