providing password reset services for a long while: circa 2025

feat: auto make data dir

Changed files
+9
features
+9
features/message-queue.ts
···
import { Database } from "bun:sqlite";
+
import { mkdir } from "node:fs/promises";
import type { Block, SlackAPIClient } from "slack-edge";
export interface SlackMessage {
···
constructor(slackClient: SlackAPIClient, dbPath = "slack-queue.db") {
this.slack = slackClient;
+
const dir = dbPath.split("/").slice(0, -1).join("/");
+
if (dir) {
+
try {
+
mkdir(dir);
+
} catch (e) {
+
// Directory may already exist
+
}
+
}
this.db = new Database(dbPath);
this.initDatabase();
this.processQueue();