Skip to content

Commit

Permalink
removed awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
Bossett committed Sep 6, 2024
1 parent ef9e0a8 commit d310d30
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/labelEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ export default async function labelEmitter() {

if (completedEvents.size > 0) {
logger.debug(`deleting ${completedEvents.size} completed events`)
await db
.delete(schema.label_actions)
.where(inArray(schema.label_actions.id, Array.from(completedEvents)))
db.delete(schema.label_actions).where(
inArray(schema.label_actions.id, Array.from(completedEvents)),
)

let outputString = `emitted ${completedEvents.size} labels in ${
Object.keys(groupedEvents).length
Expand Down
2 changes: 1 addition & 1 deletion src/lib/insertListItemOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function syncListChangeToDb(did: string, currentLabels: Set<string>) {
)

if (!isValueMapAndExistingEqual) {
await db.transaction(async (tx) => {
db.transaction(async (tx) => {
if (valueMap.length > 0) {
const validIds = await tx
.insert(schema.listItems)
Expand Down
3 changes: 1 addition & 2 deletions src/lib/insertOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export async function insertOperations(
}

if (activeOps.length > 0) {
await db
.insert(schema.label_actions)
db.insert(schema.label_actions)
.values(activeOps)
.then(() => {
logger.debug(`inserted ${activeOps.length} operations`)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/listManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export async function updateListItemURLs(
) {
if (items.length === 0) return 0
const updatedIds: { updatedId: number }[] = []
await db.transaction(async (tx) => {
db.transaction(async (tx) => {
updatedIds.push(
...(await tx
.insert(schema.listItems)
Expand Down

0 comments on commit d310d30

Please sign in to comment.