51e6817393
New controller/retry.js wraps async calls with infinite retries, capped at 30s with jitter. Applied to: TPB search, TMDB, Emby, Ollama chat, Transmission RPC, and the status/status interval calls inherit it via a Proxy around the Transmission client. Also handles ollama package returning pre-parsed JSON objects. Signed-off-by: William Mantly <wmantly@gmail.com>
15 lines
390 B
JavaScript
15 lines
390 B
JavaScript
'use strict';
|
|
|
|
const conf = require('>/conf');
|
|
const { fetchWithRetry } = require('./retry');
|
|
|
|
// Ask Emby to (re)scan its libraries so a newly filed item gets indexed.
|
|
async function refresh(){
|
|
let res = await fetchWithRetry(`${conf.emby.url}/Library/Refresh?api_key=${conf.emby.apiKey}`, {
|
|
method: 'POST',
|
|
}, { label: 'emby refresh' });
|
|
return true;
|
|
}
|
|
|
|
module.exports = { refresh };
|