Skip to content

Commit

Permalink
fix add non-zero exit
Browse files Browse the repository at this point in the history
  • Loading branch information
berkingurcan committed Sep 13, 2024
1 parent c15f54e commit 046bca5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ process.on("uncaughtException", (error) => {

const redisClient = createClient(redisConfig);

redisClient.on('error', err => log.error('Redis Client Error', err));
redisClient.on("error", (err) => log.error("Redis Client Error", err));

await redisClient.connect();
redisClient.on('connect', () => log.info('Connected to Redis server'));
redisClient.on("connect", () => log.info("Connected to Redis server"));

const rest = new REST({ version: "10" }).setToken(discordConfig.token);

Expand Down
6 changes: 3 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export const redisConfig = {
socket: {
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT,
reconnectStrategy: function(retries) {
reconnectStrategy: function (retries) {
if (retries >= 20) {
log.error("Unable to reconnect to Redis reconnectStrategy")
return new Error("Unable to reconnect to Redis reconnectStrategy");
log.error("Unable to reconnect to Redis reconnectStrategy");
process.exit(1);
}
return Math.max(retries * 500, 4000);
},
Expand Down
6 changes: 5 additions & 1 deletion src/lib/makeSurveyPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export const makeSurveyPost = async (
if (!(await redisClient.sIsMember("surveys", surveyName))) {
return [{ content: "There is no survey with that name", ephemeral: true }];
} else {
const [msg, files] = await surveyToText(redisClient, surveyName, isSummaryCommand);
const [msg, files] = await surveyToText(
redisClient,
surveyName,
isSummaryCommand,
);

const lines = msg.split("\n");
const chunks = [];
Expand Down

0 comments on commit 046bca5

Please sign in to comment.