Skip to content

zholmes1/firebase-functions-lease

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leasing system to prevent Firebase Functions from ever executing more than once.

Example Usage:

export const someFunction = functions.firestore
  .document('someCollection/{id}')
  .onCreate(async (snap, context) => {
    const lease = await createLease(context.eventId)
    if (await lease.shouldRun()) {
      // do some stuff
      await lease.markDone()
    }
  })

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published