fix: allow media upload retries

This commit is contained in:
canove
2025-05-06 08:06:05 -03:00
parent 8cc8b44724
commit f58a38fde9
4 changed files with 19 additions and 7 deletions

View File

@@ -606,7 +606,7 @@ export const getWAUploadToServer = (
{ customUploadHosts, fetchAgent, logger, options }: SocketConfig,
refreshMediaConn: (force: boolean) => Promise<MediaConnInfo>,
): WAMediaUploadFunction => {
return async(stream, { mediaType, fileEncSha256B64, timeoutMs }) => {
return async(filePath, { mediaType, fileEncSha256B64, timeoutMs }) => {
// send a query JSON to obtain the url & auth token to upload our media
let uploadInfo = await refreshMediaConn(false)
@@ -626,7 +626,7 @@ export const getWAUploadToServer = (
const body = await axios.post(
url,
stream,
createReadStream(filePath),
{
...options,
maxRedirects: 0,