Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Pause and Resume implementation wrapper using already exisiting functions#894

Open
mur2zab wants to merge4 commits intoagenda:master
base:master
Choose a base branch
Loading
frommur2zab:master

Conversation

mur2zab
Copy link

Couldn't find pause and resume functionality in the existing library. Tried to help using the existing functions. Comments are appreciated.First contribution to Open Source.

simison reacted with heart emoji
@AhmadIbrahiim
Copy link

It seems to be perfect if we can addpause andresume to AGENDA!

@simison
Copy link
Member

pause('1 day') could be an interesting feature as well (usinghuman-interval. No need in this PR, just noting for future.

@simison
Copy link
Member

simison commentedFeb 13, 2020
edited
Loading

Should pause the job test seems to be failing at the moment.@mur2zab could you have a look? Thanks!

Could you also add this to documentation (inREADME.md)

'use strict';
/**
* Pause a job into the MongoDB
* @name Job#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could you change this to@name @name Job#pause?


/**
* Resumes a job into the MongoDB
* @name Job#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could you change this to@name @name Job#resume?

* @param when time for the new nextRunAt field
* @returns {Promise} instance of Job that is resumed
*/
module.exports = function(when) {
Copy link
Member

@simisonsimisonFeb 13, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How would we resume jobs with an interval set? Should we usecomputeFromInterval?

constcomputeFromInterval=()=>{

@simison
Copy link
Member

I'd like to see tests that cover different types of jobs: requrring ones, one-off ones etc. What do you think?

@mur2zab
Copy link
Author

Should pause the job test seems to be failing at the moment.@mur2zab could you have a look? Thanks!

Could you also add this to documentation (inREADME.md)

Sure will look into the comments. Thanks for reviewing@simison

@pdfowler
Copy link
Contributor

Proposing we close this as pause/resume implementation is near identical to the existing enable/disable functionality.

From PR in thepause.js file

// Pausemodule.exports = function() {   this.attrs.disabled = true;   return this.save(); };

From existingdisable file

// Disableexport const disable = function (this: Job): Job {  this.attrs.disabled = true;  return this;};

From a DX perspective, I often got tripped up with which job methods calledsave internally and which were chainable. I have a strong preference for chainable job methods, and leaving it to the user to call save explicitly.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@simisonsimisonsimison left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@mur2zab@AhmadIbrahiim@simison@pdfowler@mur2za-b

[8]ページ先頭

©2009-2025 Movatter.jp