MCPcopy Index your code
hub / github.com/bee-queue/bee-queue / saveAll

Method saveAll

lib/queue.js:842–858  ·  view source on GitHub ↗

* Save all the provided jobs, without waiting for each job to be created. * This pipelines the requests which avoids the waiting 2N*RTT for N jobs - * the client waits to receive each command result before sending the next * command. Note that this method does not support a callback paramet

(jobs)

Source from the content-addressed store, hash-verified

840 * @modifies {arguments}
841 */
842 saveAll(jobs) {
843 return this._commandable().then((client) => {
844 const batch = client.batch(),
845 errors = new Map();
846
847 for (const job of jobs) {
848 try {
849 job
850 ._save((evalArgs) => this._evalScriptOn(batch, evalArgs))
851 .catch((err) => void errors.set(job, err));
852 } catch (err) {
853 errors.set(job, err);
854 }
855 }
856 return helpers.callAsync((done) => batch.exec(done)).then(() => errors);
857 });
858 }
859
860 _activateDelayed() {
861 if (!this.settings.activateDelayedJobs) return;

Callers 1

queue-test.jsFile · 0.80

Calls 3

_commandableMethod · 0.95
_evalScriptOnMethod · 0.95
_saveMethod · 0.80

Tested by

no test coverage detected