Skip to content

Commit

Permalink
Merge pull request #147 from 0chain/directory-update
Browse files Browse the repository at this point in the history
updated for directory
  • Loading branch information
dabasov authored Feb 22, 2025
2 parents 82dfd78 + b0b5ac8 commit f41bf4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ var migrateCmd = &cobra.Command{
}

if source == "azure" {
connectionString = fmt.Sprintf("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s", accountName, accessKey)
connectionString = fmt.Sprintf("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%sEndpointSuffix=core.windows.net", accountName, accessKey)
if err := util.SetAzureCredentials(connectionString, accountName, containerName); err != nil {
return err
}
Expand Down
11 changes: 8 additions & 3 deletions migration/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func (m *Migration) DownloadWorker(ctx context.Context, migrator *MigrationWorke
}

go func() {
f, err := os.Create(filepath.Join("files.count"))
f, err := os.Create(filepath.Join(m.workDir, "files.count"))
if err != nil {
zlogger.Logger.Error(err)
return
Expand Down Expand Up @@ -711,8 +711,13 @@ func (m *Migration) UpdateStateFile(migrateHandler *MigrationWorker) {
case <-u.DoneChan:
updateState(u.ObjectKey)
if totalMigrated == 0 {
elapsedTime := migration.endTime.Sub(migration.startTime)
os.WriteFile(filepath.Join("migration_time.txt"), []byte(fmt.Sprintf("%v", elapsedTime)), 0644)
currentTime := time.Now()
elapsedTime := currentTime.Sub(migration.startTime)

err := os.WriteFile(filepath.Join(m.workDir, "migration_time.txt"), []byte(fmt.Sprintf("%v", elapsedTime)), 0644)
if err != nil {
zlogger.Logger.Error(err)
}
}
totalMigrated++
updateMigratedFile(strconv.Itoa(totalMigrated))
Expand Down

0 comments on commit f41bf4e

Please sign in to comment.