File tree 5 files changed +39
-28
lines changed
5 files changed +39
-28
lines changed Original file line number Diff line number Diff line change @@ -90,4 +90,5 @@ Temporary Items
90
90
91
91
TODO.md
92
92
test.json
93
- spacex-api
93
+ spacex-api
94
+ .envrc
Original file line number Diff line number Diff line change @@ -7,18 +7,20 @@ const { HEALTHCHECK_PREFIX } = require('../constants');
7
7
/**
8
8
* Send fail signal to healthcheck.io
9
9
*
10
- * @param {String } id UUID of healthcheck
10
+ * @param {String } [id] UUID of healthcheck
11
11
* @param {String|Object } [msg] Message to pass to healthcheck
12
12
* @returns {Boolean } True if successful
13
13
*/
14
- module . exports = async ( id , msg = { } ) => {
15
- const response = await got . post ( {
16
- prefixUrl : HEALTHCHECK_PREFIX ,
17
- url : `${ id } /fail` ,
18
- json : msg ,
19
- } ) ;
20
- if ( response . statusCode === 200 ) {
21
- return true ;
14
+ module . exports = async ( id = null , msg = { } ) => {
15
+ if ( id ) {
16
+ const response = await got . post ( {
17
+ prefixUrl : HEALTHCHECK_PREFIX ,
18
+ url : `${ id } /fail` ,
19
+ json : msg ,
20
+ } ) ;
21
+ if ( response . statusCode === 200 ) {
22
+ return true ;
23
+ }
22
24
}
23
25
return false ;
24
26
} ;
Original file line number Diff line number Diff line change @@ -7,18 +7,20 @@ const { HEALTHCHECK_PREFIX } = require('../constants');
7
7
/**
8
8
* Send start signal to healthcheck.io
9
9
*
10
- * @param {String } id UUID of healthcheck
10
+ * @param {String } [id] UUID of healthcheck
11
11
* @param {String|Object } [msg] Message to pass to healthcheck
12
- * @returns {Boolean } true if successful
12
+ * @returns {Boolean } True if successful
13
13
*/
14
- module . exports = async ( id , msg = { } ) => {
15
- const response = await got . post ( {
16
- prefixUrl : HEALTHCHECK_PREFIX ,
17
- url : `${ id } /start` ,
18
- json : msg ,
19
- } ) ;
20
- if ( response . statusCode === 200 ) {
21
- return true ;
14
+ module . exports = async ( id = null , msg = { } ) => {
15
+ if ( id ) {
16
+ const response = await got . post ( {
17
+ prefixUrl : HEALTHCHECK_PREFIX ,
18
+ url : `${ id } /start` ,
19
+ json : msg ,
20
+ } ) ;
21
+ if ( response . statusCode === 200 ) {
22
+ return true ;
23
+ }
22
24
}
23
25
return false ;
24
26
} ;
Original file line number Diff line number Diff line change @@ -11,14 +11,16 @@ const { HEALTHCHECK_PREFIX } = require('../constants');
11
11
* @param {String|Object } [msg] Message to pass to healthcheck
12
12
* @returns {Boolean } True if successful
13
13
*/
14
- module . exports = async ( id , msg = { } ) => {
15
- const response = await got . post ( {
16
- prefixUrl : HEALTHCHECK_PREFIX ,
17
- url : `${ id } ` ,
18
- json : msg ,
19
- } ) ;
20
- if ( response . statusCode === 200 ) {
21
- return true ;
14
+ module . exports = async ( id = null , msg = { } ) => {
15
+ if ( id ) {
16
+ const response = await got . post ( {
17
+ prefixUrl : HEALTHCHECK_PREFIX ,
18
+ url : `${ id } ` ,
19
+ json : msg ,
20
+ } ) ;
21
+ if ( response . statusCode === 200 ) {
22
+ return true ;
23
+ }
22
24
}
23
25
return false ;
24
26
} ;
Original file line number Diff line number Diff line change @@ -218,6 +218,10 @@ const launchSchema = new mongoose.Schema({
218
218
type : Boolean ,
219
219
default : true ,
220
220
} ,
221
+ launch_library_id : {
222
+ type : String ,
223
+ default : null ,
224
+ } ,
221
225
} , { autoCreate : true } ) ;
222
226
223
227
const index = {
You can’t perform that action at this time.
0 commit comments