-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8dc2c36
commit 6530be3
Showing
9 changed files
with
157 additions
and
161 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import path from 'path' | ||
|
||
export const pinArtifacts = async apiClient => { | ||
const files = path.resolve(require.resolve('@aragon/aragen'), '../ipfs-cache') | ||
return apiClient.addFromFs(files, { recursive: true, ignore: 'node_modules' }) | ||
} |
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
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,2 @@ | ||
export * from './process' | ||
export * from './misc' |
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,20 @@ | ||
/** | ||
* If we don't use `clearTimeout` the process will stay alive | ||
* until the timeout has been processed: <https://nodejs.org/api/timers.html#timers_class_timeout> | ||
*/ | ||
export const withTimeout = async (promise, timeout, error) => { | ||
let timeoutObject | ||
|
||
const timeoutPromise = new Promise((resolve, reject) => { | ||
timeoutObject = setTimeout(() => { | ||
reject(error) | ||
}, timeout) | ||
}) | ||
|
||
await Promise.race([promise, timeoutPromise]) | ||
|
||
clearTimeout(timeoutObject) | ||
|
||
// return the initial promise object | ||
return promise | ||
} |
Oops, something went wrong.