mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Fixed removing from cache with --with-* flags
This commit is contained in:
parent
dc8addf062
commit
eb46dec118
2 changed files with 40 additions and 8 deletions
23
cmd/cache.go
23
cmd/cache.go
|
|
@ -62,11 +62,28 @@ var cacheRemoveCmd = &cobra.Command{
|
|||
assets = append(assets, asset)
|
||||
}
|
||||
|
||||
// add all assets with specified hosts (same host different different ports)
|
||||
// Add all assets with specified hosts (same host different different ports)
|
||||
// This should produce the following SQL:
|
||||
// DELETE FROM magellan_scanned_assets WHERE host=:host
|
||||
for _, host := range withHosts {
|
||||
|
||||
assets = append(assets, magellan.RemoteAsset{
|
||||
Host: host,
|
||||
Port: -1,
|
||||
})
|
||||
}
|
||||
// Add all assets with specified ports (same port different hosts)
|
||||
// This should produce the following SQL:
|
||||
// DELETE FROM magellan_scanned_assets WHERE port=:port
|
||||
for _, port := range withPorts {
|
||||
assets = append(assets, magellan.RemoteAsset{
|
||||
Host: "",
|
||||
Port: port,
|
||||
})
|
||||
}
|
||||
if len(assets) <= 0 {
|
||||
log.Error().Msg("nothing to do")
|
||||
os.Exit(1)
|
||||
}
|
||||
// add all assets with specified ports (same port different hosts)
|
||||
sqlite.DeleteScannedAssets(cachePath, assets...)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue