mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-26 09:44:25 +01:00
db/relays: skip if values are empty
This commit is contained in:
@@ -2,6 +2,7 @@ import { db } from '@/db.ts';
|
||||
|
||||
/** Inserts relays into the database, skipping duplicates. */
|
||||
function addRelays(relays: `wss://${string}`[]) {
|
||||
if (!relays.length) return Promise.resolve();
|
||||
const values = relays.map((url) => ({ url }));
|
||||
|
||||
return db.insertInto('relays')
|
||||
|
||||
Reference in New Issue
Block a user