(deps commandDeps)
| 1025 | } |
| 1026 | |
| 1027 | func newMemoryExtractorReplayCommand(deps commandDeps) *cobra.Command { |
| 1028 | var sessionID string |
| 1029 | |
| 1030 | cmd := &cobra.Command{ |
| 1031 | Use: "replay --session <id>", |
| 1032 | Short: "Replay Memory v2 extractor work", |
| 1033 | Args: cobra.NoArgs, |
| 1034 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 1035 | client, err := clientFromDeps(deps) |
| 1036 | if err != nil { |
| 1037 | return err |
| 1038 | } |
| 1039 | if strings.TrimSpace(sessionID) == "" { |
| 1040 | return errors.New("memory.extractor.session_required: --session is required") |
| 1041 | } |
| 1042 | response, err := client.RetryMemoryExtractor(cmd.Context(), MemoryExtractorRetryRequest{ |
| 1043 | SessionID: strings.TrimSpace(sessionID), |
| 1044 | }) |
| 1045 | if err != nil { |
| 1046 | return err |
| 1047 | } |
| 1048 | return writeCommandOutput(cmd, memoryObjectBundle("Memory Extractor Replay", response)) |
| 1049 | }, |
| 1050 | } |
| 1051 | cmd.Flags().StringVar(&sessionID, "session", "", "Session whose extractor work should be replayed") |
| 1052 | mustMarkFlagRequired(cmd, "session") |
| 1053 | return cmd |
| 1054 | } |
| 1055 | |
| 1056 | func newMemoryExtractorDrainCommand(deps commandDeps) *cobra.Command { |
| 1057 | var timeoutRaw string |
no test coverage detected