Skip to content

Commit

Permalink
fix: sync execute
Browse files Browse the repository at this point in the history
  • Loading branch information
rayriffy committed Feb 11, 2024
1 parent 5b2d9b2 commit cff9bf2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scraper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@riffyh/scraper",
"version": "1.0.3",
"version": "1.0.4",
"bin": "dist/index.js",
"publishConfig": {
"access": "public",
Expand Down
15 changes: 9 additions & 6 deletions scraper/src/commands/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ export const sync = async () => {

console.log(itemsToPush.length + ' items to push')

await db.insertInto('Hentai').values(
itemsToPush.map(item => ({
id: item.id,
data: jsonb(JSON.stringify(item)),
}))
)
await db
.insertInto('Hentai')
.values(
itemsToPush.map(item => ({
id: item.id,
data: jsonb(JSON.stringify(item)),
}))
)
.execute()
} catch (e) {
console.log(e)
} finally {
Expand Down

0 comments on commit cff9bf2

Please sign in to comment.