-
Notifications
You must be signed in to change notification settings - Fork 110
docs: add comprehensive guides for agents, cron jobs, GraphORM, and background workers #3264
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
Conversation
…ackground workers
|
🍹 The Update (preview) for dailydotdev/api/prod (at c5978ea) was successful. Resource Changes Name Type Operation
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-tag-recommendations-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
- vpc-native-api-db-migration-69c3742c kubernetes:batch/v1:Job delete
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generic-referral-reminder-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-db-migration-830ca11e kubernetes:batch/v1:Job create
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-ws-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-69c3742c kubernetes:batch/v1:Job delete
~ vpc-native-post-analytics-history-day-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-tag-view-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tags-str-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-clickhouse-migration-830ca11e kubernetes:batch/v1:Job create
|
rebelchris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non blocking thoughts
| - `pnpm run db:migrate:latest` - Apply latest migrations | ||
| - `pnpm run db:migrate:reset` - Drop schema and rerun migrations | ||
| - `pnpm run db:seed:import` - Import seed data for local development | ||
| - `pnpm run db:migrate:make` - Generate new migration based on entity changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes with nuance that it imports everything retro, maybe just say prefer the create for agent mode? it's good at filling structured stuff anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually find it safer to use make, it's battle tested and deterministic. It's up to the developer to make sure their environment is up to date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just afraid it will prompt ALL changes in a file *(pretty sure this is what happens now right?)
| - **Ack**: Message is removed from subscription | ||
| - **Nack**: Message is redelivered (with exponential backoff) | ||
|
|
||
| ### Error Handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something it's also good it validated params.
EG it's userId it could be user deleted in meantime so it should query internally to validate preferably?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
care to elaborate a bit more on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases for instance now with external messages (gondul example where match can be made, but used deleted account in mean time)
The worker ideally should query user from database vs simply hoping it exists to avoid endless errors.
|
@rebelchris any document you think i missed? one of our primary workflows maybe? |
|
@idoshamun Seems pretty ok to me, maybe that we prefer zod as much as possible? |
No description provided.