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
morebits: batchOperation: minor improvements #782
morebits: batchOperation: minor improvements #782
Conversation
…empty. When the pageList is empty, a quick abort results. Ideally, the postFinish() function should be executed even in this case.
673c714
to
071013f
Compare
ctx.running = false; | ||
if (ctx.postFinish) { | ||
ctx.postFinish(); |
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 think this is better than modifying fnDoneOne
or something, if only for simplicity's sake, but even workerFailure
calls fnDoneOne
. It's a weird construct there overall.
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.
All looks pretty clear to me! One minor suggested change, but otherwise looks great. I don't love arg
but can't come up with anything better that's still concise.
If using mw.Api() (or anything other than Morebits.wiki.page/api) for processing pages in the worker, till now it was not possible to have invidual status lines for each page. This commit rectifies this deficiency by allowing a string input to workerSuccess() that would be treated as the page name, triggering individual status line generation. I've changed the condition `if (apiobj && apiobj.getStatusElement)` to `if (apiobj instanceof Morebits.wiki.page || apiobj instanceof Morebits.wiki.api)`. These are functionally same, but the latter is more explicit and clearer.
071013f
to
9cf1877
Compare
1st commit: doc fixes.
2nd commit: execute
postFinish()
even when thepageList
is empty. This situation could occur when the pageList used is variable.3rd commit: allow individual status lines even if the
worker
function is not usingMorebits.wiki.page
orMorebits.wiki.api
.These will not have any effect on Twinkle.