Background Job
Background Job service API reference
Messages
ProcessingHistory
Historical information about a background job that processes a domain entity.
| Field | Type | Description |
|---|---|---|
latest_job | ...oodmem.v1.BackgroundJobSummary | Details about the most recent job execution. |
attempts | ...oodmem.v1.BackgroundJobAttempt | Attempt-level telemetry in reverse-chronological order. |
BackgroundJobSummary
Summary of a background job's current execution state.
| Field | Type | Description |
|---|---|---|
job_id | int64 | The numeric identifier of the background job. |
job_type | string | The job type (matches bg_job.job_type). |
status | goodmem.v1.BackgroundJobStatus | Current state of the job. |
attempts | int32 | Number of attempts started so far. |
max_attempts | int32 | Maximum allowed attempts for this job. |
run_at | google.protobuf.Timestamp | When the job becomes eligible to run again. |
lease_until | google.protobuf.Timestamp | Lease expiration if currently running; unset if no active lease. |
locked_by | string | Worker currently holding the lease, if any. |
last_error | string | Short error message from the last failure, if any. |
updated_at | google.protobuf.Timestamp | Last time the job row was updated. |
BackgroundJobAttempt
Per-attempt telemetry captured while a background job runs.
| Field | Type | Description |
|---|---|---|
attempt_id | int64 | The numeric identifier of the attempt. |
job_id | int64 | Owning background job identifier. |
started_at | google.protobuf.Timestamp | When the attempt started. |
finished_at | google.protobuf.Timestamp | When the attempt finished, if applicable. |
ok | bool | True if the attempt succeeded, false if failed, unset if running. |
worker_id | string | The worker processing the attempt. |
status_message | string | Latest status message reported by the worker. |
progress_current | int64 | The current progress value. |
progress_total | int64 | Total progress target, if known. |
progress_unit | string | Unit label for progress metrics (e.g., "pages"). |
progress_updated_at | google.protobuf.Timestamp | When progress fields were last updated. |
error_message | string | Short error message for failures. |
error_stacktrace | string | Captured stack trace for failures, possibly truncated. |
Enums
BackgroundJobStatus
Execution state of a background job within the GoodMem job framework.
| Name | Value | Description |
|---|---|---|
BACKGROUND_JOB_STATUS_UNSPECIFIED | 0 | The default value. Invalid on writes. |
BACKGROUND_JOB_PENDING | 1 | Eligible to run but not yet leased. |
BACKGROUND_JOB_RUNNING | 2 | Currently running with an active lease. |
BACKGROUND_JOB_SUCCEEDED | 3 | Finished successfully. |
BACKGROUND_JOB_FAILED | 4 | Exhausted retries or failed permanently. |
BACKGROUND_JOB_CANCELED | 5 | Explicitly canceled or expired. |