DUBLK 2000 Admin commited on
Commit
7073ecd
·
1 Parent(s): e13bd68

Add optimized WebP poster hosting, payment idempotency, key separation

Browse files
Files changed (1) hide show
  1. server.js +1 -1
server.js CHANGED
@@ -1853,7 +1853,7 @@ const warmRun = new Set();
1853
  function kickWarmAhead(bot, rec, msgId, fromOff, fileSize, wantBytes) {
1854
  const id = String(msgId);
1855
  const need = Number(wantBytes) || 0;
1856
- const span = Math.max(0, Math.min(CHUNK_SIZE * 4, need));
1857
  const chunks = Math.max(1, Math.min(WARM_AHEAD, Math.ceil(span / CHUNK_SIZE)));
1858
  const start = Math.floor(Math.max(0, fromOff) / CHUNK_SIZE) * CHUNK_SIZE;
1859
  const warmKey = id + ":" + Math.floor(start / (16 * MB));
 
1853
  function kickWarmAhead(bot, rec, msgId, fromOff, fileSize, wantBytes) {
1854
  const id = String(msgId);
1855
  const need = Number(wantBytes) || 0;
1856
+ const span = Math.max(0, Math.min(CHUNK_SIZE * WARM_AHEAD, need));
1857
  const chunks = Math.max(1, Math.min(WARM_AHEAD, Math.ceil(span / CHUNK_SIZE)));
1858
  const start = Math.floor(Math.max(0, fromOff) / CHUNK_SIZE) * CHUNK_SIZE;
1859
  const warmKey = id + ":" + Math.floor(start / (16 * MB));