You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
make unstash work for parallel executions (#2095)
without 'int' in a 'for (i = 0; ...)' loop 'i' is a global variable and the value gets inside some parallel execution randomly incremented from the parallel threads. Defining it with the keyword 'int' makes it a method local variable which does not change its value 'randomly'. Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
@@ -92,7 +92,7 @@ def unstash(name, msg = "Unstash failed:") {
|
||||
def unstashAll(stashContent) {
|
||||
def unstashedContent = []
|
||||
if (stashContent) {
|
||||
for (i = 0; i < stashContent.size(); i++) {
|
||||
for (int i = 0; i < stashContent.size(); i++) {
|
||||
if (stashContent[i]) {
|
||||
unstashedContent += unstash(stashContent[i])
|
||||
}
|
||||
|
Reference in New Issue
Block a user