mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-31 18:10:50 +01:00
feat: updated dependency api
This commit is contained in:
@@ -100,7 +100,10 @@ func (svr DependencyServiceServer) Sync(_ context.Context, request *grpc.Depende
|
||||
for _, d := range depsDb {
|
||||
_, ok := depsMap[d.Name]
|
||||
if !ok {
|
||||
depIdsToDelete = append(depIdsToDelete, d.Id)
|
||||
// Only delete dependencies that are uninstalled/error/abnormal and older than 7 days
|
||||
if d.Status != constants.DependencyStatusInstalled && time.Since(d.UpdatedAt) > 7*24*time.Hour {
|
||||
depIdsToDelete = append(depIdsToDelete, d.Id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user