-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: increase the connection pool size to allow more concurrent connections to the SQLite database. * fix: remove .then() and use async/await * fix: remove .then() and use async/await * fix: use transaction instead of workaround/trick * fix: remove unnecessary console.log(...) * fix: set max pool to 1 for sqlite3 database
- Loading branch information
Showing
4 changed files
with
115 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
export const metaData = { | ||
getActivity: (knex, date) => { | ||
return knex | ||
.select('*') | ||
.from('heartbeats') | ||
.whereBetween('time', [date.end, date.start]) | ||
.then((res) => res) | ||
.catch((error) => console.log(error)); | ||
getActivity: async (knex, date) => { | ||
try { | ||
return await knex | ||
.select('*') | ||
.from('heartbeats') | ||
.whereBetween('time', [date.end, date.start]); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}, | ||
removeActivity: (knex, data) => { | ||
return knex('heartbeats') | ||
.whereIn('id', data.idsWakatime) | ||
.del() | ||
.then((res) => res) | ||
.catch((error) => console.log(error)); | ||
|
||
removeActivity: async (knex, data) => { | ||
try { | ||
return await knex('heartbeats') | ||
.whereIn('id', data.idsWakatime) | ||
.del(); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters