* 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)
| 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; |
no test coverage detected