@@ -89,7 +89,7 @@ type WorkerRepository interface {
8989 ListActiveSDKsPerTenant (ctx context.Context ) (map [TenantIdSDKTuple ]int64 , error )
9090
9191 // GetWorkerActionsByWorkerId returns a list of actions for a worker
92- GetWorkerActionsByWorkerId (ctx context.Context , tenantId uuid.UUID , workerId []uuid. UUID ) (map [string ][]string , error )
92+ GetWorkerActionsForWorkers (ctx context.Context , tenantId uuid.UUID , workers []sqlcv1. Worker ) (map [string ][]string , error )
9393
9494 // GetWorkerWorkflowsByWorkerId returns a list of workflows for a worker
9595 GetWorkerWorkflowsByWorkerId (ctx context.Context , tenantId uuid.UUID , workerId uuid.UUID ) ([]* sqlcv1.Workflow , error )
@@ -276,7 +276,13 @@ func (w *workerRepository) CountActiveWorkersPerTenant(ctx context.Context) (map
276276 return tenantToWorkers , nil
277277}
278278
279- func (w * workerRepository ) GetWorkerActionsByWorkerId (ctx context.Context , tenantId uuid.UUID , workerIds []uuid.UUID ) (map [string ][]string , error ) {
279+ func (w * workerRepository ) GetWorkerActionsForWorkers (ctx context.Context , tenantId uuid.UUID , workers []sqlcv1.Worker ) (map [string ][]string , error ) {
280+ actionHashToWorkerId := make (map [uuid.UUID ][]byte )
281+
282+ for _ , worker := range workers {
283+ actionHashToWorkerId [worker .ID ] = worker .ActionsHash
284+ }
285+
280286 records , err := w .queries .GetWorkerActionsByWorkerId (ctx , w .pool , sqlcv1.GetWorkerActionsByWorkerIdParams {
281287 Workerids : workerIds ,
282288 Tenantid : tenantId ,
0 commit comments