-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Added experimental background job queue #20985
base: main
Are you sure you want to change the base?
Changes from 2 commits
fa3773a
0944f8e
cbfb1a2
d74d339
e3b68ec
f47448b
713dcc4
4b3b928
85c28ea
010369b
62807b9
e253203
125f3d7
7aeb7e0
5508cfd
c602c67
2cd905f
e5529c0
aa8fc8b
6694210
2fd8caf
22b76b0
1d77f5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const queries = require('../../lib/queries'); | ||
|
||
/** | ||
* Updates email analytics for a specific member | ||
* | ||
* @param {Object} options - The options object | ||
* @param {string} options.memberId - The ID of the member to update analytics for | ||
* @returns {Promise<Object>} The result of the aggregation query (1/0) | ||
*/ | ||
module.exports = async function updateMemberEmailAnalytics({memberId}) { | ||
const result = await queries.aggregateMemberStats(memberId); | ||
return result; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ const initTestMode = () => { | |
}, 5000); | ||
}; | ||
|
||
const jobManager = new JobManager({errorHandler, workerMessageHandler, JobModel: models.Job, domainEvents}); | ||
const jobManager = new JobManager({errorHandler, workerMessageHandler, JobModel: models.Job, domainEvents, isDuplicate: true}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker but just a note for future: it would be good to get to the bottom of why we need two instances of the job system, and ideally fix that so we don't need this anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed! I've got a note to look into this because this is rather clunky way of handling it that I'm also really not a fan of. |
||
|
||
module.exports = jobManager; | ||
module.exports.initTestMode = initTestMode; |
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.
Do you have a sense of how big we'd expect this field to actually be? I wonder if allowing a maxlength this large is potentially encouraging misuse of this field?
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 originally had it like other text fields at 2000 chars. I think that ought to be sufficient, but this is why I was holding off on the migration. We could start with 2000 and go from there?
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.
Yeah 2000 seems more sane to me — in most cases this should basically be a resource ID and maybe a couple small pieces of metadata (e.g. a timestamp or two, maybe a url pointing to a file or storage bucket, etc.)
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.
Cool, I'll bump back. Basically, since this is a 'JSON' field I had copied what we had elsewhere. Agree it seems to be overkill and it's easier to bump up than down.
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.
Adjusted. If I mark this resolved, does it also resolve it for you? I forget how GH handles that.