mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Add db cleanup api
This commit is contained in:
committed by
Lorenzo Bolla
parent
f09a273ad7
commit
b4efe6a810
@@ -7,6 +7,9 @@ import (
|
||||
// AllLocalReposResourcesKey to be used as resource key when all local repos are needed
|
||||
const AllLocalReposResourcesKey = "__alllocalrepos__"
|
||||
|
||||
// AllResourcesKey to be used as resource key when all resources are needed
|
||||
const AllResourcesKey = "__all__"
|
||||
|
||||
// ResourceConflictError represents a list tasks
|
||||
// using conflicitng resources
|
||||
type ResourceConflictError struct {
|
||||
@@ -51,6 +54,12 @@ func (r *ResourcesSet) UsedBy(resources []string) []Task {
|
||||
tasks = appendTask(tasks, task)
|
||||
}
|
||||
}
|
||||
} else if resource == AllResourcesKey {
|
||||
for _, task := range r.set {
|
||||
tasks = appendTask(tasks, task)
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
task, found = r.set[resource]
|
||||
@@ -63,6 +72,10 @@ func (r *ResourcesSet) UsedBy(resources []string) []Task {
|
||||
if found {
|
||||
tasks = appendTask(tasks, task)
|
||||
}
|
||||
task, found = r.set[AllResourcesKey]
|
||||
if found {
|
||||
tasks = appendTask(tasks, task)
|
||||
}
|
||||
|
||||
return tasks
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user