-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow retransmission requests for singular segments (#22)
* initial sqlite tables * exit app can now retransfer requested segmetns * fix compilaion errors * gently nudging node towards performance breakdown * scheduled more lenient transfer * updating to retransfer uhttp * fix tests * adjust docker build to current verison
- Loading branch information
Showing
9 changed files
with
299 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,6 @@ coverage/ | |
node_modules/ | ||
|
||
# Created by github pipeline | ||
gha-creds-*.json | ||
gha-creds-*.json | ||
|
||
*.sqlite3 |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sqlite3 from 'sqlite3'; | ||
|
||
export type DB = sqlite3.Database; | ||
|
||
export function setup(dbFile: string): Promise<DB> { | ||
return new Promise((res, rej) => { | ||
const db: sqlite3.Database = new sqlite3.Database(dbFile, (err) => { | ||
if (err) { | ||
return rej(`Error creating db: ${err}`); | ||
} | ||
return res(db); | ||
}); | ||
}); | ||
} | ||
|
||
export function close(db: DB): Promise<void> { | ||
return new Promise((res, rej) => { | ||
db.close((err) => { | ||
if (err) { | ||
return rej(`Error closing db: ${err}`); | ||
} | ||
return res(); | ||
}); | ||
}); | ||
} |
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
Oops, something went wrong.