mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 13:29:10 +08:00 
			
		
		
		
	Add paralleExecute index to logs
This commit is contained in:
		
							
								
								
									
										4
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -28332,6 +28332,7 @@ class Batch {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        this.concurrency = concurrency;
 | 
					        this.concurrency = concurrency;
 | 
				
			||||||
        this.emitter = new events.EventEmitter();
 | 
					        this.emitter = new events.EventEmitter();
 | 
				
			||||||
 | 
					        this.index = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Add a operation into queue.
 | 
					     * Add a operation into queue.
 | 
				
			||||||
@@ -28385,6 +28386,7 @@ class Batch {
 | 
				
			|||||||
     *
 | 
					     *
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    parallelExecute() {
 | 
					    parallelExecute() {
 | 
				
			||||||
 | 
					        const local_index = this.index++;
 | 
				
			||||||
        if (this.state === BatchStates.Error) {
 | 
					        if (this.state === BatchStates.Error) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -28395,7 +28397,9 @@ class Batch {
 | 
				
			|||||||
        while (this.actives < this.concurrency) {
 | 
					        while (this.actives < this.concurrency) {
 | 
				
			||||||
            const operation = this.nextOperation();
 | 
					            const operation = this.nextOperation();
 | 
				
			||||||
            if (operation) {
 | 
					            if (operation) {
 | 
				
			||||||
 | 
					                console.log(`parallelExecute ${local_index} starting execution of operation ${this.operation}. Active count: ${this.actives}`);
 | 
				
			||||||
                operation();
 | 
					                operation();
 | 
				
			||||||
 | 
					                console.log(`parallelExecute ${local_index} finished execution of operation ${this.operation}. Active count: ${this.actives}`);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user