From cc5f2e98b763b76f1b0d705efcedaa2ea031ad09 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 28 Apr 2022 10:18:27 +0100 Subject: [bugfix] Fix possible race condition in federatingdb (#490) Signed-off-by: kim --- vendor/github.com/superseriousbusiness/activity/pub/database.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'vendor/github.com/superseriousbusiness/activity/pub/database.go') diff --git a/vendor/github.com/superseriousbusiness/activity/pub/database.go b/vendor/github.com/superseriousbusiness/activity/pub/database.go index 8d3bbd465..5c58c60ce 100644 --- a/vendor/github.com/superseriousbusiness/activity/pub/database.go +++ b/vendor/github.com/superseriousbusiness/activity/pub/database.go @@ -19,12 +19,7 @@ type Database interface { // processes require tight loops acquiring and releasing locks. // // Used to ensure race conditions in multiple requests do not occur. - Lock(c context.Context, id *url.URL) error - // Unlock makes the lock for the object at the specified id available. - // If an error is returned, the lock must have still been freed. - // - // Used to ensure race conditions in multiple requests do not occur. - Unlock(c context.Context, id *url.URL) error + Lock(c context.Context, id *url.URL) (unlock func(), err error) // InboxContains returns true if the OrderedCollection at 'inbox' // contains the specified 'id'. // -- cgit v1.3