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

Sequence or Delays #327

Closed
isaadabbasi opened this issue May 23, 2022 · 1 comment
Closed

Sequence or Delays #327

isaadabbasi opened this issue May 23, 2022 · 1 comment

Comments

@isaadabbasi
Copy link

I am using concurrently in a monorepo, where some packages are dependent on each other.
The following script elaborates the sequences processes needs to run.

const { result } = concurrently([
  {
    command: 'npm run build:watch',
    name: 'shared',
    cwd: path.resolve(process.cwd(), 'packages/shared'),
  },
  {
    command: 'npm run build:watch',
    name: 'db',
    cwd: path.resolve(process.cwd(), 'packages/db'),
  },
  {
    command: 'npm run dev',
    name: 'gql',
    cwd: path.resolve(process.cwd(), 'packages/gql'),
  },
], {
  killOthers: ['failure'],
  prefix: 'someproject',
  restartTries: 3,
  resartDelay: 3000
})

I wan't these scripts to run sequentially. I get that - the entire point of this package is concurrently running processes (not sequentially).
Can i some how run these with delays in between
2 seconds wait after packages/shared build
2 seconds wait after packages/db build
build packages/gql

@gustavohenke
Copy link
Member

This request is similar to #265.
You can also already do it with the programmatic API like this: #201 (comment)

But honestly, you will have some sort of flakiness when depending exclusively on time to have your builds passing.
#201 (comment) lists a way using wait-on which is a great tool for waiting for e.g. a file or server to be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants