(entityID, runnerGroupName string)
| 470 | } |
| 471 | |
| 472 | func (e *EntityCache) GetEntityRunnerGroup(entityID, runnerGroupName string) (int64, bool) { |
| 473 | e.mux.Lock() |
| 474 | defer e.mux.Unlock() |
| 475 | |
| 476 | if _, ok := e.entities[entityID]; ok { |
| 477 | if runnerGroup, ok := e.entities[entityID].RunnerGroups[runnerGroupName]; ok { |
| 478 | if time.Now().UTC().After(runnerGroup.time.Add(1 * time.Hour)) { |
| 479 | delete(e.entities[entityID].RunnerGroups, runnerGroupName) |
| 480 | return 0, false |
| 481 | } |
| 482 | return runnerGroup.RunnerGroupID, true |
| 483 | } |
| 484 | } |
| 485 | return 0, false |
| 486 | } |
| 487 | |
| 488 | func SetEntityRunnerGroup(entityID, runnerGroupName string, runnerGroupID int64) { |
| 489 | entityCache.SetEntityRunnerGroup(entityID, runnerGroupName, runnerGroupID) |
no test coverage detected