Skip to content

Commit 31638d2

Browse files
committed
chore: wait for phishtank to init first before gettingthe phishingset
1 parent 1e5aa54 commit 31638d2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/services/user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ export async function findOrCreateUser(msg: Message): Promise<boolean> {
4343
commandCount: 1,
4444
},
4545
});
46+
return true;
4647
} catch (error) {
4748
log.error("Database", `Failed to find or create user.`, error);
4849
}
49-
return true;
50+
return false;
5051
}
5152

5253
export async function getUserbyLid(lid: string) {

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ const monitor = new MemoryMonitor({
1818
thresholdMB: parseInt(process.env.PROJECT_THRESHOLD_MEMORY || "1024", 10),
1919
});
2020
const phishtank = new PhishTankClient();
21-
const phishingSet: Set<string> = phishtank.getPhishingSet();
21+
let phishingSet: Set<string>;
2222

2323
async function main() {
2424
checkRequirements();
2525
monitor.start();
2626
phishtank.startAutoUpdateLoop();
2727
await phishtank.init();
28+
phishingSet = phishtank.getPhishingSet();
2829
await client.initialize();
2930

3031
mapCommands();

0 commit comments

Comments
 (0)