-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from TogetherCrew/redis-queue-retry-option
[FIXBUG]: set redis attempts to 0
- Loading branch information
Showing
6 changed files
with
198 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ src/config/*.env | |
# compiled output | ||
/dist | ||
/node_modules | ||
/lib | ||
|
||
#migration | ||
migrate.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 14 additions & 23 deletions
37
src/migrations/db/1695210587863-add-isgeneratedbyweebhook-to-rawinfo-schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,29 @@ | ||
import 'dotenv/config'; | ||
import { Client, GatewayIntentBits, } from 'discord.js'; | ||
import { Client, GatewayIntentBits } from 'discord.js'; | ||
import { guildService } from '../../database/services'; | ||
import { connectDB } from '../../database'; | ||
import { databaseService } from '@togethercrew.dev/db'; | ||
import config from '../../config'; | ||
import { closeConnection } from '../../database/connection'; | ||
import webhookLogic from '../utils/webhookLogic'; | ||
|
||
const { | ||
Guilds, | ||
GuildMembers, | ||
GuildMessages, | ||
GuildPresences, | ||
DirectMessages | ||
} = GatewayIntentBits; | ||
|
||
const { Guilds, GuildMembers, GuildMessages, GuildPresences, DirectMessages } = GatewayIntentBits; | ||
|
||
export const up = async () => { | ||
const client = new Client({ | ||
intents: [Guilds, GuildMembers, GuildMessages, GuildPresences, DirectMessages], | ||
}); | ||
const client = new Client({ | ||
intents: [Guilds, GuildMembers, GuildMessages, GuildPresences, DirectMessages], | ||
}); | ||
|
||
await client.login(config.discord.botToken); | ||
await connectDB(); | ||
const guilds = await guildService.getGuilds({}); | ||
for (let i = 0; i < guilds.length; i++) { | ||
const connection = databaseService.connectionFactory(guilds[i].guildId, config.mongoose.dbURL); | ||
await webhookLogic(connection, client, guilds[i].guildId); | ||
await closeConnection(connection); | ||
} | ||
await client.login(config.discord.botToken); | ||
await connectDB(); | ||
const guilds = await guildService.getGuilds({}); | ||
for (let i = 0; i < guilds.length; i++) { | ||
const connection = databaseService.connectionFactory(guilds[i].guildId, config.mongoose.dbURL); | ||
await webhookLogic(connection, client, guilds[i].guildId); | ||
await closeConnection(connection); | ||
} | ||
}; | ||
|
||
export const down = async () => { | ||
// TODO: Implement rollback logic if needed | ||
// TODO: Implement rollback logic if needed | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.