Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Dec 8, 2025

Improve worker function tracking and lifecycle management

This PR refines the worker function tracking mechanism and improves worker lifecycle management:

  1. Removed last_invoked_at from track_worker_function() to separate concerns:

    • Worker registration is now handled by track_worker_function()
    • Debounce protection is managed by ensure_workers() setting last_invoked_at
  2. Enhanced worker lifecycle management:

    • Workers now only start when in the "Created" state
    • Added isCreated getter to lifecycle interfaces
    • Added comprehensive unit tests for Worker.startOnlyOnce()
  3. Updated migration file with clearer extension creation comments

  4. Fixed tests to reflect the new behavior:

    • Updated debounce tests to manually set last_invoked_at
    • Adjusted worker function tracking tests

These changes improve separation of concerns and make the worker startup process more robust.

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

⚠️ No Changeset found

Latest commit: f703acd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

jumski commented Dec 8, 2025

@nx-cloud
Copy link

nx-cloud bot commented Dec 8, 2025

View your CI Pipeline Execution ↗ for commit 696273c

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 3m 51s View ↗
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 30s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 2m 14s View ↗
nx run edge-worker:e2e ✅ Succeeded 49s View ↗
nx run client:e2e ✅ Succeeded 1m 8s View ↗
nx run cli:e2e ✅ Succeeded 3s View ↗
nx run core:pgtap ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-08 08:02:31 UTC

@jumski jumski force-pushed the 12-08-simplify_track_worker_function_by_removing_debounce_responsibility branch 2 times, most recently from a34d33c to 696273c Compare December 8, 2025 07:55
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-520.pgflow.pages.dev

📝 Details:

  • Branch: 12-08-simplify_track_worker_function_by_removing_debounce_responsibility
  • Commit: eb322e443a1ca4518b713098067e5123e84654bb
  • View Logs

_Last updated: _

Copy link
Contributor Author

jumski commented Dec 8, 2025

Merge activity

  • Dec 8, 8:07 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 8, 9:46 AM UTC: Graphite rebased this pull request as part of a merge.
  • Dec 8, 9:46 AM UTC: @jumski merged this pull request with Graphite.

@jumski jumski changed the base branch from 12-07-finalization_remove_drop_statements_from_schemas_remove_setupensureworkerscron_from_e2e_tests_add_changeset to graphite-base/520 December 8, 2025 09:43
@jumski jumski changed the base branch from graphite-base/520 to main December 8, 2025 09:44
@jumski jumski force-pushed the 12-08-simplify_track_worker_function_by_removing_debounce_responsibility branch from 696273c to f703acd Compare December 8, 2025 09:45
@jumski jumski merged commit d784ae0 into main Dec 8, 2025
11 of 12 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

🚀 Production Deployment: Website

Successfully deployed to production!

🔗 Production URL: https://pgflow.dev

📝 Details:

  • Commit: d784ae0868b166de3eb28bd4e81fb3b8ca64a18a
  • View Logs

Deployed at: 2025-12-08T10:46:26+01:00

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