Skip to content

sync is bad #1

@mzarra

Description

@mzarra

DispatchQueue.global(qos: .background).sync {

I would recommend never using sync here. It is just asking for pain down the road.

This should be async and the UI must wait for the persistence layer to be ready. Normally this is < 100ms and not noticeable by the UI. But when a merge or some other long task runs the UI must be able to handle it. Plan for it and when it happens it is not an issue. Don't plan for it and you are asking for a re-write in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions