{"id":20926116,"url":"https://github.com/starhoshi/retrycf","last_synced_at":"2026-05-05T01:31:15.983Z","repository":{"id":57153641,"uuid":"117513760","full_name":"starhoshi/retrycf","owner":"starhoshi","description":"Fire Cloud Functions again.","archived":false,"fork":false,"pushed_at":"2018-03-14T14:32:14.000Z","size":534,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-20T05:16:51.624Z","etag":null,"topics":["cloud-function-for-firebase","cloud-functions","firestore","javascript","npm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/starhoshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-15T07:46:46.000Z","updated_at":"2019-03-14T02:34:32.000Z","dependencies_parsed_at":"2022-09-06T19:21:38.261Z","dependency_job_id":null,"html_url":"https://github.com/starhoshi/retrycf","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2Fretrycf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2Fretrycf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2Fretrycf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starhoshi%2Fretrycf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starhoshi","download_url":"https://codeload.github.com/starhoshi/retrycf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318756,"owners_count":20272144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-function-for-firebase","cloud-functions","firestore","javascript","npm","typescript"],"created_at":"2024-11-18T20:36:54.110Z","updated_at":"2025-12-30T01:58:27.765Z","avatar_url":"https://github.com/starhoshi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/starhoshi/retrycf/master/docs/logo.png\" width='250px' /\u003e\n\u003c/p\u003e\n\n# retrycf [![npm version](https://badge.fury.io/js/retrycf.svg)](https://badge.fury.io/js/retrycf) [![Build Status](https://travis-ci.org/starhoshi/retrycf.svg?branch=master)](https://travis-ci.org/starhoshi/retrycf) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/cb022ff28cab4b0085eb64f07f37a8bb)](https://www.codacy.com/app/kensuke1751/retrycf?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=starhoshi/retrycf\u0026amp;utm_campaign=Badge_Grade) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nretrycf is an npm library that fire Cloud Functions again when it fails.\n\n## Install\n\n```\nyarn install retrycf\n```\n\n## Usage\n\n```ts\nexport const updateTestOrder = functions.firestore.document(`order/{orderID}`).onUpdate(async event =\u003e {\n  const retryStatus = Retrycf.retryStatus(event.data.data(), event.data.previous.data())\n  switch (retryStatus) {\n      case Retrycf.Status.ShouldRetry:\n      case Retrycf.Status.ShouldNotRetry:\n          break\n      case Retrycf.Status.RetryFailed:\n          throw Error('Retry failed')\n      default:\n          break\n  }\n  \n  try {\n    await main(order)\n    return undefined\n  } catch (e) {\n    await Retrycf.setRetry(event.data.ref, event.data.data(), e)\n    return Promise.reject(e)\n  }\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarhoshi%2Fretrycf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarhoshi%2Fretrycf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarhoshi%2Fretrycf/lists"}