Skip to content

Conversation

@benjie
Copy link
Member

@benjie benjie commented Oct 15, 2025

Need to test this before merging.

@github-project-automation github-project-automation bot moved this to 🌳 Triage in V5.0.0 Oct 15, 2025
@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2025

🦋 Changeset detected

Latest commit: 6a4e3b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
graphile-build Patch
postgraphile Patch
grafserv Patch
@dataplan/pg Patch
pgl Patch
grafast Patch
graphile-build-pg Patch
graphile-utils Patch
graphile Patch
@grafserv/persisted Patch
@localrepo/grafast-bench Patch
@dataplan/json Patch
ruru-components Patch
@localrepo/grafast-website Patch
graphile-export Patch

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

@benjie benjie moved this from 🌳 Triage to 🌱 In Progress in V5.0.0 Oct 16, 2025
@benjie
Copy link
Member Author

benjie commented Oct 22, 2025

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 watchtest

With

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.

@benjie benjie marked this pull request as ready for review October 22, 2025 09:26
…and integrate with grafserv's `setPreset` middleware. Promises returned by such now delay schema application, preventing growing concurrent work.
@benjie benjie merged commit 3a8ba73 into main Oct 22, 2025
46 checks passed
@benjie benjie deleted the watch-queue branch October 22, 2025 10:06
@github-project-automation github-project-automation bot moved this from 🌱 In Progress to ✅ Done in V5.0.0 Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants