setFilePriority(options) { const fileIndices = getEnsuredArray(options.fileIndices); const hashes = getEnsuredArray(options.hashes); hashes.forEach(hash => { fileIndices.forEach(fileIndex => { this.requests.push(getMethodCall('f.priority.set', [`${hash}:f${fileIndex}`, options.priority])); }); this.requests.push(getMethodCall('d.update_priorities', [hash])); }); }
setFilePriority(user, services, hashes, data, callback) { // TODO Add support for multiple hashes. const {fileIndices} = data; const request = new ClientRequest(user, services); request.setFilePriority({hashes, fileIndices, priority: data.priority}); request.onComplete((response, error) => { services.torrentService.fetchTorrentList(); callback(response, error); }); request.send(); }
test('aliases changeLevelName to levelKey', async ({ is }) => { const instance = pino({ changeLevelName: 'priority' }, sink((result, enc, cb) => { is(result.priority, 30) cb() })) instance.info('hello world') })
getInvalidationKeyValues() { return Promise.all( (this.preAggregation.invalidateKeyQueries || []) .map( (keyQuery, i) => this.loadCache.keyQueryResult( keyQuery, this.waitForRenew, this.priority(10), (this.preAggregation.refreshKeyRenewalThresholds || [])[i] ) ) ); }
setPriority(options) { const hashes = getEnsuredArray(options.hashes); hashes.forEach(hash => { this.requests.push(getMethodCall('d.priority.set', [hash, options.priority])); this.requests.push(getMethodCall('d.update_priorities', [hash])); }); }
function Pc(a){var b=tc(a.target);if(null!==b){var c=dc(b);if(null!==c)if(b=c.tag,13===b){if(b=ec(c),null!==b){a.blockedOn=b;r.unstable_runWithPriority(a.priority,function(){yc(c)});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}
Object.keys(plugins).sort(function(a, b) { var p1 = plugins[a]; var p2 = plugins[b]; return util.compare(p1.priority, p2.priority) || util.compare(p2.mtime, p1.mtime) || (a > b ? 1 : -1); }).forEach(function(name) { var plugin = plugins[name]; pluginsOptions.push({ name: name.slice(0, -1), icon: 'checkbox', mtime: plugin.mtime, homepage: plugin.homepage, latest: plugin.latest, hideLongProtocol: plugin.hideLongProtocol, hideShortProtocol: plugin.hideShortProtocol }); });
async getQueryStage(stageQueryKey, priorityFilter, queryStageState) { const [active, toProcess, allQueryDefs] = queryStageState || await this.fetchQueryStageState(); const queryDefs = toProcess.map(k => allQueryDefs[k]).filter(q => !!q); const queryInQueue = queryDefs.find(q => this.redisHash(q.stageQueryKey) === this.redisHash(stageQueryKey) && (priorityFilter != null ? q.priority === priorityFilter : true)); if (queryInQueue) { if (active.indexOf(this.redisHash(queryInQueue.queryKey)) !== -1) { return { stage: 'Executing query', timeElapsed: queryInQueue.startQueryTime ? new Date().getTime() - queryInQueue.startQueryTime : undefined }; } const index = queryDefs.filter(q => active.indexOf(this.redisHash(q.queryKey)) === -1).indexOf(queryInQueue); if (index !== -1) { return index !== -1 ? { stage: `#${index + 1} in queue` } : undefined; } } return undefined; }
scheduleRefresh(invalidationKeys, newVersionEntry) { this.logger('Refreshing pre-aggregation content', { preAggregation: this.preAggregation, requestId: this.requestId, queryKey: this.preAggregationQueryKey(invalidationKeys), newVersionEntry }); this.executeInQueue(invalidationKeys, this.priority(0), newVersionEntry) .catch(e => { if (!(e instanceof ContinueWaitError)) { this.logger('Error refreshing pre-aggregation', { error: (e.stack || e), preAggregation: this.preAggregation, requestId: this.requestId }); } }); }
it("should create with default options", () => { const span = new Span(tracer, "test-123"); expect(span.tracer).toBe(tracer); expect(span.logger).toBe(tracer.logger); expect(span.opts).toEqual({}); expect(span.meta).toEqual({}); expect(span.name).toBe("test-123"); expect(span.type).toBe("custom"); expect(span.id).toBe("12345678-abcdef"); expect(span.traceID).toBe(span.id); expect(span.parentID).toBeUndefined(); expect(span.service).toBeUndefined(); expect(span.priority).toBe(5); expect(span.sampled).toBe(true); expect(span.startTime).toBeNull(); expect(span.finishTime).toBeNull(); expect(span.duration).toBeNull(); expect(span.error).toBeNull(); expect(span.logs).toEqual([]); expect(span.tags).toEqual({}); expect(tracer.shouldSample).toBeCalledTimes(1); expect(tracer.shouldSample).toBeCalledWith(span); });
test('changes label naming when told to', async ({ is }) => { const expected = [{ priority: 30, msg: 'hello world' }] const instance = pino({ formatters: { level (label, number) { return { priority: number } } } }, sink((result, enc, cb) => { const current = expected.shift() is(result.priority, current.priority) is(result.msg, current.msg) cb() })) instance.info('hello world') })
setPriority(user, services, hashes, data, callback) { const request = new ClientRequest(user, services); request.setPriority({hashes, priority: data.priority}); request.onComplete((response, error) => { services.torrentService.fetchTorrentList(); callback(response, error); }); request.send(); }
test('setting levelKey does not affect labels when told to', async ({ is }) => { const instance = pino( { formatters: { level (label, number) { return { priority: label } } } }, sink((result, enc, cb) => { is(result.priority, 'info') cb() }) ) instance.info('hello world') })