mirror of
https://github.com/restic/restic.git
synced 2024-12-24 16:54:00 +00:00
pass proper context into MasterIndex.RebuildIndex
This commit is contained in:
parent
2964d2ad15
commit
d6cfe857b7
1 changed files with 2 additions and 2 deletions
|
@ -267,7 +267,7 @@ func (mi *MasterIndex) MergeFinalIndexes() {
|
||||||
// RebuildIndex combines all known indexes to a new index, leaving out any
|
// RebuildIndex combines all known indexes to a new index, leaving out any
|
||||||
// packs whose ID is contained in packBlacklist. The new index contains the IDs
|
// packs whose ID is contained in packBlacklist. The new index contains the IDs
|
||||||
// of all known indexes in the "supersedes" field.
|
// of all known indexes in the "supersedes" field.
|
||||||
func (mi *MasterIndex) RebuildIndex(packBlacklist restic.IDSet) (*Index, error) {
|
func (mi *MasterIndex) RebuildIndex(ctx context.Context, packBlacklist restic.IDSet) (*Index, error) {
|
||||||
mi.idxMutex.Lock()
|
mi.idxMutex.Lock()
|
||||||
defer mi.idxMutex.Unlock()
|
defer mi.idxMutex.Unlock()
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ func (mi *MasterIndex) RebuildIndex(packBlacklist restic.IDSet) (*Index, error)
|
||||||
|
|
||||||
newIndex := NewIndex()
|
newIndex := NewIndex()
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.TODO())
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
for i, idx := range mi.idx {
|
for i, idx := range mi.idx {
|
||||||
|
|
Loading…
Reference in a new issue