Skip to content

code is using time.Sleep when doing periodic task #647

@nirrozenbaum

Description

@nirrozenbaum

in some places in the code, there is a periodic task needs to be executed and the code is using time.sleep which is a bad practice.
for example, time.sleep may cause delays when receiving SIGTERM - if the go routine started the sleep section we will need to wait until sleep competes and only then the go routine will exist (due to context close).

the Go way for doing periodic task endlessly (until a cancel/close is received) is by using ticker.

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