-
-
Couldn't load subscription status.
- Fork 604
Implement queue for watchGather/watchSchema/etc #2777
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
🦋 Changeset detectedLatest commit: 6a4e3b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Tested via: (for I in `seq 1 1000`; do echo 'create table my_table(id serial primary key, name text); drop table my_table;'; done) | psql watchtestWith let schemaCounter = 0;
const DelaySetPresetPlugin = {
name: "DelaySetPresetPlugin",
grafserv: {
middleware: {
setPreset(next, event) {
return sleep(1000).then(next);
},
},
},
schema: {
hooks: {
finalize(schema, build) {
console.log(`Produced ${++schemaCounter}th schema`);
return schema;
},
},
},
};Running PostGraphile hooked up to this schema created 24 schemas total, even though the above should have triggered 2000 schema build notifications. The 1 second delay was clearly respected. |
…and integrate with grafserv's `setPreset` middleware. Promises returned by such now delay schema application, preventing growing concurrent work.
Need to test this before merging.