Source: apps/search_console_tools/core/executor.py.

๐ŸŽฏ Purpose

CommandRequestExecutor executes a CommandRequest and persists the result in the database.

Responsibilities:

  • set status=IN_PROGRESS
  • execute the command through GoogleSearchConsoleEngine
  • save result, errors, and finished_at
  • attach a screenshot (if the engine captured it)

๐Ÿ”„ Status transitions

  • NEW โ†’ IN_PROGRESS
  • then:
    • COMPLETED (no errors)
    • FAILED (exception raised)

๐Ÿงพ result / errors

  • executor tries to serialize result via json.dumps
  • if that fails, it stores str(result)
  • errors are stored as errors=str(e)