-
Notifications
You must be signed in to change notification settings - Fork 390
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
Refactor scripts class #1240
Refactor scripts class #1240
Conversation
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.
Looks good to me, just a small question.
src/classes/worker.ts
Outdated
@@ -430,7 +430,7 @@ export class Worker< | |||
token: string, | |||
jobId?: string, | |||
): Promise<Job<DataType, ResultType, NameType>> { | |||
const [jobData, id] = await Scripts.moveToActive(this, token, jobId); | |||
const [jobData, id] = await this.scripts.moveToActive(this, token, jobId); |
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 needed to pass "this" in this case?
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.
yes, here it was missing that change, in last commit should be addressed
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.
Looks good, a smal comment.
src/classes/job.ts
Outdated
} | ||
} | ||
|
||
toJSON() { | ||
const { queue, ...withoutQueue } = this; | ||
const { queue, scripts, ...withoutQueue } = 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.
now it should be called: withoutQueueAndScripts. :).
In general, I think this pattern can lead to bugs because it is easy to forget to remove what you do not want and end the serialization of unneeded things. Even if more tedious, it is probably better to manually select the properties you want to serialize.
🎉 This PR is included in version 1.82.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.