mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-05-11 18:36:17 +02:00
add explicit test checks in reset
This commit is contained in:
parent
7ba654e476
commit
436e75e3e6
1 changed files with 2 additions and 2 deletions
|
@ -6,14 +6,14 @@ import { Pool } from "pg";
|
|||
import { Logger } from "../../src/utils/logger";
|
||||
|
||||
export async function resetRedis() {
|
||||
if (config?.redis?.enabled) {
|
||||
if (config?.redis?.enabled && config.mode === "test") {
|
||||
const client = createClient(config.redis);
|
||||
await client.connect();
|
||||
await client.flushAll();
|
||||
}
|
||||
}
|
||||
export async function resetPostgres() {
|
||||
if (process.env.TEST_POSTGRES && config.postgres) {
|
||||
if (process.env.TEST_POSTGRES && config.mode == "test" && config.postgres) {
|
||||
const pool = new Pool({ ...config.postgres });
|
||||
await pool.query(`DROP DATABASE IF EXISTS "sponsorTimes"`);
|
||||
await pool.query(`DROP DATABASE IF EXISTS "privateDB"`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue