Skip to content

Commit

Permalink
Ignore conflicts when inserting user_did maps (bluesky-social#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee authored Apr 12, 2022
1 parent 8902bbf commit 8ac84dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export class Database {
did: string,
host: string,
): Promise<void> {
await this.db.insert({ username, did, host }).into('user_dids')
await this.db
.insert({ username, did, host })
.into('user_dids')
.onConflict()
.ignore()
}

async getDidForUser(username: string, host: string): Promise<string | null> {
Expand Down

0 comments on commit 8ac84dc

Please sign in to comment.