Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

The @workglow/job-queue v0.0.84 removed JobQueue and InMemoryRateLimiter exports in favor of separate JobQueueServer, JobQueueClient, and EvenlySpacedRateLimiter classes.

Changes

Updated src/task/index/FetchDailyIndexTask.test.ts to match the pattern in src/commands/index.ts:

// Old pattern
getTaskQueueRegistry().registerQueue(
  new JobQueue(SecJobQueueName, SecFetchJob, {
    storage: new InMemoryQueueStorage(SecJobQueueName),
    limiter: new InMemoryRateLimiter({ maxExecutions: 10, windowSizeInSeconds: 1 }),
  })
);
getTaskQueueRegistry().startQueues();

// New pattern
const storage = new InMemoryQueueStorage<Input, Output>(SecJobQueueName);
const server = new JobQueueServer<Input, Output, SecFetchJob>(SecFetchJob, {
  queueName: SecJobQueueName,
  storage,
  limiter: new EvenlySpacedRateLimiter({ maxExecutions: 10, windowSizeInSeconds: 1 }),
  pollIntervalMs: 1,
});
const client = new JobQueueClient<Input, Output>({ storage, queueName: SecJobQueueName });
client.attach(server);
getTaskQueueRegistry().registerQueue({ server, client, storage });
server.start();

The test now instantiates server/client separately, attaches them, and manages the server lifecycle directly rather than through the registry.

Original prompt

Reference: https://github.com/workglow-dev/sec/actions/runs/20579720891/job/59104451742#step:6:1

Look at index.ts to see how to setup a jobqueue now. Fix all the tests.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Note

Migrates the test to the new job-queue API and aligns setup with index.ts.

  • Replace JobQueue/InMemoryRateLimiter with JobQueueServer/JobQueueClient and EvenlySpacedRateLimiter
  • Introduce shared InMemoryQueueStorage, attach client to server, register { server, client, storage }, and call server.start()/server.stop()
  • Set pollIntervalMs: 1 and update imports; no production code changes

Written by Cursor Bugbot for commit add04a8. This will update automatically on new commits. Configure here.

Co-authored-by: sroussey <127349+sroussey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tests for job queue setup in index.ts Update tests for @workglow/job-queue v0.0.84 API changes Dec 29, 2025
Copilot AI requested a review from sroussey December 29, 2025 20:29
@sroussey sroussey marked this pull request as ready for review December 29, 2025 20:30
@sroussey sroussey merged commit b829fc2 into main Dec 29, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants