Socket
Book a DemoInstallSign in
Socket

@backstage/backend-tasks

Package Overview
Dependencies
Maintainers
3
Versions
984
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backstage/backend-tasks

Common distributed task management library for Backstage backends

0.6.1
latest
Source
npmnpm
Version published
Weekly downloads
41K
-5.3%
Maintainers
3
Weekly downloads
 
Created
Source

@backstage/backend-tasks

[!CAUTION] This package is deprecated and will be removed in a near future.

Common distributed task management for Backstage backends.

Usage

[!CAUTION] Please note that the documentation below is only valid for versions equal to or below 0.5.28-next.3. As this package will be deleted soon, we recommend that you migrate to the new backend system, and depend on coreServices.scheduler from @backstage/backend-plugin-api instead, or use DefaultSchedulerService from @backstage/backend-defaults. Here are the backend and plugin migration guides.

Add the library to your backend package:

# From your Backstage root directory
yarn --cwd packages/backend add @backstage/backend-tasks

then make use of its facilities as necessary:

import { TaskScheduler } from '@backstage/backend-tasks';

const scheduler = TaskScheduler.fromConfig(rootConfig).forPlugin('my-plugin');

await scheduler.scheduleTask({
  id: 'refresh_things',
  frequency: { cron: '*/5 * * * *' }, // every 5 minutes, also supports Duration
  timeout: { minutes: 15 },
  fn: async () => {
    await entityProvider.run();
  },
});

Keywords

backstage

FAQs

Package last updated on 27 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.