Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support running the app in API/background mode only #112

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ahonn
Copy link
Collaborator

@ahonn ahonn commented Apr 29, 2024

Changes

  • add APP_MODE env var to change app mode
  /**
   * Application Mode
   * - full: Full application mode, includes API and background tasks.
   * - api_only: API only mode, excludes background tasks.
   * - background_only: Background tasks only mode, excludes API.
   */
  APP_MODE: z.enum(['full', 'api', 'background']).default('full'),
  • add UNLOCKER_CRON_TASK_ENABLE env var to enable/disable unlock cron task
  /**
   * Enable BTCTimeLock cell unlock cron task
   * set to false to disable the BTCTimeLock cell unlock cron task
   */
  UNLOCKER_CRON_TASK_ENABLE: z
    .enum(['true', 'false'])
    .default('true')
    .transform((value) => value === 'true'),

Copy link

vercel bot commented Apr 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
btc-assets-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 3:10am

@ahonn ahonn marked this pull request as ready for review May 2, 2024 01:17
@ahonn ahonn requested a review from mfuuzy May 2, 2024 01:17
@Flouse
Copy link
Contributor

Flouse commented May 13, 2024

  • add UNLOCKER_CRON_TASK_ENABLE env var to enable/disable unlock cron task

Is UNLOCKER_CRON_TASK_ENABLE deprecated?
I can't see the related code.

@ahonn
Copy link
Collaborator Author

ahonn commented May 13, 2024

  • add UNLOCKER_CRON_TASK_ENABLE env var to enable/disable unlock cron task

Is UNLOCKER_CRON_TASK_ENABLE deprecated? I can't see the related code.

Opss, it seems that a mistake caused the previous git rebase, and the relevant code was removed.
I will be adding the related code back ASAP.

@Flouse
Copy link
Contributor

Flouse commented Jun 17, 2024

I think a new discussion is needed later, because some cached APIs need background jobs too.
e.g.

  • UTXOSyncer
  • RgbppCollector
  • TransactionProcessor ?

@Flouse Flouse marked this pull request as draft June 17, 2024 04:06
@Flouse Flouse added the P-Low label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants