Skip to content

Lock deletion code should use SQL server timestamp #7

@markerrj

Description

@markerrj

https://github.com/ambitioninc/django-db-mutex/blob/develop/db_mutex/db_mutex.py#L83

Here the code deletes locks based on a datetime.now() calculation. I believe this means that if all servers aren't properly NTP-time-synced, the locks could be accidentally deleted sooner than expected on servers with time set in the future.

This code should be doing lock deletion based on the SQL server knowledge of time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions