Skip to content

Commit

Permalink
Set add ttl to chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jotacemarin committed Sep 8, 2024
1 parent dcd69a5 commit baba12c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib/dao/chatMessageDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export class ChatMessageDao {
ChatMessageDao.chatMessageSchema = new Schema(
{
message: { type: Schema.Types.Mixed, required: true },
expireAt: { type: Schema.Types.Date, expires: 20 },
expireAt: { type: Schema.Types.Date, expires: 43200 },
},
{
timestamps: true,
expireAfterSeconds: 30,
expireAfterSeconds: 43200,
}
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/lib/services/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios, { AxiosResponse, AxiosInstance } from "axios";
import { EntityTg, UserTg, FormattingOptionsTg } from "../models";
import { MessageTg } from "../models/telegram";

const { TELEGRAM_BOT_TOKEN, USERNAME, PASSWORD } = process.env;
const { TELEGRAM_BOT_TOKEN } = process.env;

interface SetWebhookResponse {
ok: boolean;
Expand Down Expand Up @@ -157,7 +157,6 @@ export class TelegramService {
if (!this.instance) {
this.instance = axios.create({
baseURL: `https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}`,
auth: { username: `${USERNAME}`, password: `${PASSWORD}` },
});
}
}
Expand Down

0 comments on commit baba12c

Please sign in to comment.