Size of the snapshot in metadata fix
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		
							parent
							
								
									d2b935b85c
								
							
						
					
					
						commit
						4e56ab7657
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
					@ -142,14 +142,9 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
 | 
				
			||||||
		Labels:    labels,
 | 
							Labels:    labels,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err := s.saveMetadata(snapshot)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		return snapshot.KeyName(s.IndexLabel), fmt.Errorf("saving metadata error: %v", err)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	tmpSnapshotArchivePath := path.Join(s.TmpSnapshotPath, snapshot.KeyName(s.IndexLabel)+".tar.zst")
 | 
						tmpSnapshotArchivePath := path.Join(s.TmpSnapshotPath, snapshot.KeyName(s.IndexLabel)+".tar.zst")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = os.Chdir(path.Join(s.AppsPath, appName))
 | 
						err := os.Chdir(path.Join(s.AppsPath, appName))
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return snapshot.KeyName(s.IndexLabel), fmt.Errorf("change working directory error: %v", err)
 | 
							return snapshot.KeyName(s.IndexLabel), fmt.Errorf("change working directory error: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -165,6 +160,11 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	snapshot.Labels = append(snapshot.Labels, fmt.Sprintf("size:%d", info.Size()))
 | 
						snapshot.Labels = append(snapshot.Labels, fmt.Sprintf("size:%d", info.Size()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						err = s.saveMetadata(snapshot)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return snapshot.KeyName(s.IndexLabel), fmt.Errorf("saving metadata error: %v", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Clean after myself
 | 
						// Clean after myself
 | 
				
			||||||
	defer func() {
 | 
						defer func() {
 | 
				
			||||||
		err = os.Remove(tmpSnapshotArchivePath)
 | 
							err = os.Remove(tmpSnapshotArchivePath)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue