Skip to content

Base job datetimes on the finished_at field, rather than started_at #1284

Description

@jjnesbitt

In the job processor, we rely on the started_at field, and simply compute the finished_at field, using the duration of the job. This is somewhat problematic, as some jobs may legitimately have a missing started_at field. The most prominent example are jobs that were enqueued for so long that they timed out, and were marked as "failed". Since they never started, the started_at field is NULL.

However, any job that has a status of success or failed (the jobs we process) will essentially always have a non-null finished_at field (skipped and cancelled jobs can have this field missing, but we don't process those). We should rely on this field when processing jobs, so that a started_at value of NULL doesn't lead to inaccurate data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    analytics-dbRelating to the Analytics Database and/or Django application

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions