ChannelArchiver: break out of the loop if there are no more messages to archive
This commit is contained in:
parent
64f7b8cce4
commit
cd07a3e32e
1 changed files with 1 additions and 0 deletions
|
@ -99,6 +99,7 @@ export class ChannelArchiverPlugin extends ZeppelinPlugin {
|
|||
while (archivedMessages < maxMessagesToArchive) {
|
||||
const messagesToFetch = Math.min(MAX_MESSAGES_PER_FETCH, maxMessagesToArchive - archivedMessages);
|
||||
const messages = await args.channel.getMessages(messagesToFetch, previousId);
|
||||
if (messages.length === 0) break;
|
||||
|
||||
for (const message of messages) {
|
||||
const ts = moment.utc(message.timestamp).format("YYYY-MM-DD HH:mm:ss");
|
||||
|
|
Loading…
Add table
Reference in a new issue