Skip to content

Commit

Permalink
[FEATURE]: increase the JOB time limit + save 100 msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Oct 26, 2023
1 parent 6bda216 commit e2c5e32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/functions/fetchMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,27 @@ async function fetchMessages(
}
channel instanceof ThreadChannel
? await pushMessagesToArray(connection, messagesToStore, [...fetchedMessages.values()], {
threadId: channel.id,
threadName: channel.name,
channelId: channel.parent?.id,
channelName: channel.parent?.name,
})
threadId: channel.id,
threadName: channel.name,
channelId: channel.parent?.id,
channelName: channel.parent?.name,
})
: await pushMessagesToArray(connection, messagesToStore, [...fetchedMessages.values()]);
break;
}

channel instanceof ThreadChannel
? await pushMessagesToArray(connection, messagesToStore, [...fetchedMessages.values()], {
threadId: channel.id,
threadName: channel.name,
channelId: channel.parent?.id,
channelName: channel.parent?.name,
})
threadId: channel.id,
threadName: channel.name,
channelId: channel.parent?.id,
channelName: channel.parent?.name,
})
: await pushMessagesToArray(connection, messagesToStore, [...fetchedMessages.values()]);
await rawInfoService.createRawInfos(connection, messagesToStore);
options[fetchDirection] = boundaryMessage.id;
fetchedMessages = await channel.messages.fetch(options);
}
await rawInfoService.createRawInfos(connection, messagesToStore);
} catch (err) {
logger.error(
{ guild_id: connection.name, channel_id: channel.id, fetchDirection, err },
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function app() {
port: config.redis.port,
password: config.redis.password,
},
lockDuration: 7200000, // 2 hour
lockDuration: 79200000, // 22 hours
}
);

Expand Down

0 comments on commit e2c5e32

Please sign in to comment.