MCPcopy Create free account
hub / github.com/Y80/bmm / saveUserCheckHostsTask

Function saveUserCheckHostsTask

src/controllers/BookmarkHostCheck.controller.ts:275–293  ·  view source on GitHub ↗
(userId: UserId, task: CheckHostsTaskValue)

Source from the content-addressed store, hash-verified

273}
274
275async function saveUserCheckHostsTask(userId: UserId, task: CheckHostsTaskValue) {
276 const value = task as typeof userConfigs.$inferInsert.value
277 await db
278 .insert(userConfigs)
279 .values({
280 userId,
281 key: CHECK_HOSTS_TASK_KEY,
282 value,
283 updatedAt: new Date(),
284 })
285 .onConflictDoUpdate({
286 target: [userConfigs.userId, userConfigs.key],
287 set: {
288 value,
289 updatedAt: new Date(),
290 },
291 })
292 return task
293}
294
295async function getPublicBookmarkHostKeys() {
296 return await db.select({ hostKey: publicBookmarks.hostKey }).from(publicBookmarks)

Callers 1

startUserCheckHostsTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected