fastify / fastify/help

Locking operations in fastify routes

Open
#776 2 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
No language data
Stars
68
Forks
8
Avg merge
11h 2m
Merged PRs (30d)
2

Description

Hello!

I am curious about people's thoughts on approaches to handling locking operations within fastify routes. I have a typical lock use case, where I have a global resource (file) that needs to be updated one at a time in response to inbound requests (or drop the request and have the requester retry if the lock is held).

Currently I am using [proper-lockfile](https://www.npmjs.com/package/proper-lockfile) to handle this through a file lock, which works well, but I am wondering if there are any native ways of handling this in fastify that may be more performant. I have looked into [fastify-locks](https://github.com/piscinajs/fastify-locks) but was unable to get it running and unsure if it is still maintained.

Thanks for your time and this excellent project!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.