Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12886dd

Browse files
committed
Merge branch '313-delete-conflict-dump-files' into 'master'
feat: clean up only files or directories that are specified to be restored (#313)Closes #313See merge request postgres-ai/database-lab!410
2 parentse09f72b +b78397d commit12886dd

File tree

1 file changed

+4
-9
lines changed
  • internal/retrieval/engine/postgres/logical

1 file changed

+4
-9
lines changed

‎internal/retrieval/engine/postgres/logical/dump.go‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func (d *DumpJob) Run(ctx context.Context) (err error) {
335335
}
336336
}
337337

338-
iferr:=d.cleanupDumpLocation(ctx,dumpCont.ID);err!=nil {
338+
iferr:=d.cleanupDumpLocation(ctx,dumpCont.ID,dbList);err!=nil {
339339
returnerr
340340
}
341341

@@ -406,23 +406,18 @@ func (d *DumpJob) getPassword() string {
406406
returnpwd
407407
}
408408

409-
func (d*DumpJob)cleanupDumpLocation(ctx context.Context,dumpContIDstring)error {
409+
func (d*DumpJob)cleanupDumpLocation(ctx context.Context,dumpContIDstring,dbListmap[string]DumpDefinition)error {
410410
ifd.DumpOptions.DumpLocation==""||d.DumpOptions.Restore.Enabled {
411411
returnnil
412412
}
413413

414-
ls,err:=tools.LsContainerDirectory(ctx,d.dockerClient,dumpContID,d.DumpOptions.DumpLocation)
415-
iferr!=nil {
416-
returnerrors.Wrap(err,"failed to clean up dump location")
417-
}
418-
419-
iflen(ls)==0 {
414+
iflen(dbList)==0 {
420415
returnnil
421416
}
422417

423418
cleanupCmd:= []string{"rm","-rf"}
424419

425-
for_,dbName:=rangels {
420+
fordbName:=rangedbList {
426421
cleanupCmd=append(cleanupCmd,path.Join(d.DumpOptions.DumpLocation,dbName))
427422
}
428423

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp