(entity params.ForgeEntity)
| 72 | } |
| 73 | |
| 74 | func composeWatcherFilters(entity params.ForgeEntity) dbCommon.PayloadFilterFunc { |
| 75 | // We want to watch for changes in either the controller or the |
| 76 | // entity itself. |
| 77 | return watcher.WithAny( |
| 78 | watcher.WithAll( |
| 79 | // Updates to the controller |
| 80 | watcher.WithEntityTypeFilter(dbCommon.ControllerEntityType), |
| 81 | watcher.WithOperationTypeFilter(dbCommon.UpdateOperation), |
| 82 | ), |
| 83 | // Any operation on the entity we're managing the pool for. |
| 84 | watcher.WithEntityFilter(entity), |
| 85 | // Watch for changes to the github credentials |
| 86 | watcher.WithForgeCredentialsFilter(entity.Credentials), |
| 87 | watcher.WithAll( |
| 88 | watcher.WithEntityJobFilter(entity), |
| 89 | watcher.WithAny( |
| 90 | watcher.WithOperationTypeFilter(dbCommon.UpdateOperation), |
| 91 | watcher.WithOperationTypeFilter(dbCommon.CreateOperation), |
| 92 | watcher.WithOperationTypeFilter(dbCommon.DeleteOperation), |
| 93 | ), |
| 94 | ), |
| 95 | ) |
| 96 | } |
| 97 | |
| 98 | func (r *basePoolManager) getQueuedJobs() []params.Job { |
| 99 | r.mux.Lock() |
no test coverage detected