-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
feat(core): Add command to trigger license refresh on workers #7184
feat(core): Add command to trigger license refresh on workers #7184
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Make sure to check off this list before asking for review. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #7184 +/- ##
==========================================
- Coverage 32.66% 32.65% -0.01%
==========================================
Files 3337 3340 +3
Lines 199394 199463 +69
Branches 21833 21849 +16
==========================================
+ Hits 65129 65132 +3
- Misses 133189 133251 +62
- Partials 1076 1080 +4
☔ View full report in Codecov by Sentry. |
packages/cli/src/License.ts
Outdated
if (this.manager) { | ||
async init(instanceId: string, instanceType: N8nInstanceType = 'main') { | ||
const isMainInstance = instanceType === 'main'; | ||
if (this.manager && isMainInstance) { |
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.
why is && isMainInstance
needed here?
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.
because we dont want to redo the init() on the main instances (since they were the onces who actually did the license renewal), only on the workers. so if the manager was already initialised on main, just return
if we can use the reload() instead of init(), maybe we don't even need all this
case 'reloadLicense': | ||
const instanceId = Container.get(License).instanceId; | ||
if (instanceId) { | ||
await Container.get(License).init(instanceId, 'main'); |
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.
can we use the License SDK's reload()
function instead?
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.
If that effectively does the same, sure!
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.
LGTM
1 flaky test on run #2190 ↗︎
Details:
cypress/e2e/24-ndv-paired-item.cy.ts • 1 flaky test
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
✅ All Cypress E2E specs passed |
# [1.8.0](https://github.com/n8n-io/n8n/compare/[email protected]@1.8.0) (2023-09-20) ### Bug Fixes * **core:** Make parsing of content-type and content-disposition headers more flexible ([#7217](#7217)) ([d41546b](d41546b)), closes [#7149](#7149) * **core:** Resolve domains to IPv4 first ([#7206](#7206)) ([e9ce531](e9ce531)) * **editor:** Add ssh key type selection to source control settings when regenerating key ([#7172](#7172)) ([54bf66d](54bf66d)) * **editor:** No need to add click emitting click events, VUE delegates the handler to the root element of the component ([#7182](#7182)) ([3c055e4](3c055e4)) * **editor:** Prevent duplicate creation of credential for OAuth2 ([#7163](#7163)) ([07a6417](07a6417)) * **editor:** Testing flaky resource mapper feature in e2e tests ([#7165](#7165)) ([aaf87c3](aaf87c3)) * **HTML Node:** Add pairedItem support for 'Convert to HTML Table' operation ([#7196](#7196)) ([6bc477b](6bc477b)) * **HTTP Request Node:** Decrease default timeout to 5min ([#7177](#7177)) ([321780d](321780d)) * **seven Node:** Rename sms77 to seven, fix credentials test ([#7180](#7180)) ([cf776b8](cf776b8)) * **X (Formerly Twitter) Node:** Rename Twitter to X (keep Twitter alias) ([#7179](#7179)) ([d317e09](d317e09)) ### Features * **core:** Add command to trigger license refresh on workers ([#7184](#7184)) ([9f797b9](9f797b9)) * **core:** Add rsa option to ssh key generation ([#7154](#7154)) ([fdac2c8](fdac2c8)) * **Linear Node:** Add support for OAuth2 ([#7201](#7201)) ([12a3168](12a3168)) * **Microsoft Outlook Node:** Node overhaul ([#4449](#4449)) ([556a613](556a613)) * **Set Node:** Overhaul ([#6348](#6348)) ([3a47455](3a47455)) Co-authored-by: krynble <[email protected]>
## [1.8.1](https://github.com/n8n-io/n8n/compare/[email protected]@1.8.1) (2023-09-21) ### Bug Fixes * **Airtable Node:** Attachments field type fix ([#7227](#7227)) ([ebfcc87](ebfcc87)) * **core:** Handle filename* with quotes in Content-Disposition header ([#7229](#7229)) ([fb36b0a](fb36b0a)) * Ensure new Set node is on top of search list ([#7215](#7215)) ([c8fb06f](c8fb06f)) * Issue enforcing user limits on start plan ([#7188](#7188)) ([50a4c5e](50a4c5e)) ### Reverts * **core:** Add command to trigger license refresh on workers ([#7184](#7184)) ([6ac19a5](6ac19a5)) Co-authored-by: netroy <[email protected]>
Got released with |
This PR implements the updated license SDK so that worker and webhook instances do not auto-renew licenses any more.
Instead, they receive a
reloadLicense
command via the Redis client that will fetch the updated license after it was saved on the main instanceThis also contains some refactoring with moving redis sub and pub clients into the event bus directly, to prevent cyclic dependency issues.