Adjust delivery job timeouts
ci/woodpecker/tag/ociImageTag Pipeline was successful
Details
ci/woodpecker/tag/ociImageTag Pipeline was successful
Details
This commit is contained in:
parent
b6bc717416
commit
5f4ab23b8d
|
@ -26,7 +26,7 @@ async function getRpcClient(): Promise<Socket> {
|
||||||
}
|
}
|
||||||
|
|
||||||
client = new Socket();
|
client = new Socket();
|
||||||
client.setMaxListeners(1024);
|
client.setMaxListeners(10240);
|
||||||
|
|
||||||
const [host, portStr] = config.rpcHost.trim().split(/:(?=[0-9]+$)/, 2);
|
const [host, portStr] = config.rpcHost.trim().split(/:(?=[0-9]+$)/, 2);
|
||||||
const port = parseInt(portStr);
|
const port = parseInt(portStr);
|
||||||
|
@ -82,7 +82,7 @@ async function getRpcClient(): Promise<Socket> {
|
||||||
const data = buf.readBuffer(dataLen);
|
const data = buf.readBuffer(dataLen);
|
||||||
dataDecoded = decode(data);
|
dataDecoded = decode(data);
|
||||||
} else {
|
} else {
|
||||||
dataDecoded = { success: false, data: "RPC returned failure" };
|
dataDecoded = {success: false, data: "RPC returned failure"};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move the rest of the data to the beginning of the buffer
|
// Move the rest of the data to the beginning of the buffer
|
||||||
|
@ -99,7 +99,7 @@ async function getRpcClient(): Promise<Socket> {
|
||||||
const reconnectWithBackoff = () => {
|
const reconnectWithBackoff = () => {
|
||||||
client!.destroy();
|
client!.destroy();
|
||||||
client = new Socket();
|
client = new Socket();
|
||||||
client.setMaxListeners(1024);
|
client.setMaxListeners(10240);
|
||||||
|
|
||||||
setTimeout(() => createClient(client!), 1000 * (1 + Math.pow(1.5, exponentialBackoff)));
|
setTimeout(() => createClient(client!), 1000 * (1 + Math.pow(1.5, exponentialBackoff)));
|
||||||
};
|
};
|
||||||
|
@ -139,7 +139,7 @@ async function rpcCall<D, T>(method: string, data: D): Promise<T> {
|
||||||
client.off("error", clearAndReject);
|
client.off("error", clearAndReject);
|
||||||
client.removeAllListeners(`mag-data:${currentSerial}`);
|
client.removeAllListeners(`mag-data:${currentSerial}`);
|
||||||
reject(new Error("Promise timeout"))
|
reject(new Error("Promise timeout"))
|
||||||
}, 60000);
|
}, 75000);
|
||||||
|
|
||||||
const clearAndReject = (e: any) => {
|
const clearAndReject = (e: any) => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
|
@ -171,7 +171,7 @@ export function deliver(user: ThinUser, content: unknown, to: string | null) {
|
||||||
|
|
||||||
return deliverQueue.add(data, {
|
return deliverQueue.add(data, {
|
||||||
attempts: config.deliverJobMaxAttempts || 12,
|
attempts: config.deliverJobMaxAttempts || 12,
|
||||||
timeout: 60 * 1000, // 1min
|
timeout: 3 * 60 * 1000, // 3min
|
||||||
backoff: {
|
backoff: {
|
||||||
type: "apBackoff",
|
type: "apBackoff",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue