( _ context.Context, mutation ExpireTaskBlocksMutation, )
| 866 | } |
| 867 | |
| 868 | func (s *inMemoryManagerStore) ExpireTaskBlocks( |
| 869 | _ context.Context, |
| 870 | mutation ExpireTaskBlocksMutation, |
| 871 | ) (ExpireTaskBlocksResult, error) { |
| 872 | now := mutation.Now.UTC() |
| 873 | if now.IsZero() { |
| 874 | now = time.Date(2026, 4, 14, 15, 0, 0, 0, time.UTC) |
| 875 | } |
| 876 | expired := make([]TaskBlock, 0) |
| 877 | taskIDs := make([]string, 0, len(s.blocks)) |
| 878 | for taskID := range s.blocks { |
| 879 | taskIDs = append(taskIDs, taskID) |
| 880 | } |
| 881 | sort.Strings(taskIDs) |
| 882 | for _, taskID := range taskIDs { |
| 883 | taskBlocks := s.blocks[taskID] |
| 884 | blockIDs := make([]string, 0, len(taskBlocks)) |
| 885 | for blockID := range taskBlocks { |
| 886 | blockIDs = append(blockIDs, blockID) |
| 887 | } |
| 888 | sort.Strings(blockIDs) |
| 889 | for _, blockID := range blockIDs { |
| 890 | block := taskBlocks[blockID] |
| 891 | if !block.ClearedAt.IsZero() || block.ExpiresAt.IsZero() || block.ExpiresAt.After(now) { |
| 892 | continue |
| 893 | } |
| 894 | block.ClearedAt = now |
| 895 | block.ClearedBy = ActorIdentity{ |
| 896 | Kind: mutation.ClearedBy.Kind.Normalize(), |
| 897 | Ref: strings.TrimSpace(mutation.ClearedBy.Ref), |
| 898 | } |
| 899 | block.ClearNote = "" |
| 900 | taskBlocks[blockID] = cloneTaskBlock(block) |
| 901 | expired = append(expired, cloneTaskBlock(block)) |
| 902 | } |
| 903 | } |
| 904 | return ExpireTaskBlocksResult{Blocks: expired}, nil |
| 905 | } |
| 906 | |
| 907 | func (s *inMemoryManagerStore) BlockTaskAndReleaseRun( |
| 908 | _ context.Context, |
nothing calls this directly
no test coverage detected