@@ -30,17 +30,17 @@ const TRIM_PR_NAME_LENGHT = 35;
30
30
* The default cron expression described as:
31
31
* At minute 0 past hour 9 and 18 on every day-of-week from Monday through Friday.
32
32
*/
33
- const TO_DO_TIME = config . to_do_time || '0 9,20 * * 1-5' ;
33
+ const TO_DO_TIME = config . to_do_time ;
34
34
/**
35
35
* The default cron expression described as:
36
36
* At minute 0 past hour 9 and 18 on every day-of-week from Monday through Friday.
37
37
*/
38
- const PR_TIME = config . pr_time || '0 9,20 * * 1-5' ;
38
+ const PR_TIME = config . pr_time ;
39
39
/**
40
40
* The default cron expression described as:
41
41
* At 21:00 on every day-of-week from Monday through Friday.
42
42
*/
43
- const MEETING_TIME = config . meeting_time || '0 21 * * 1-5' ;
43
+ const MEETING_TIME = config . meeting_time ;
44
44
const octokit = new Octokit ( { auth : TOKEN } ) ;
45
45
46
46
const MEMBERS_QUERY = require ( './queries/members' ) ;
@@ -389,57 +389,79 @@ function parseMeetingMessage(mentionList) {
389
389
* Call the Github GraphQL API, parse its response to message and add that message as cron job.
390
390
*/
391
391
async function main ( ) {
392
- const meetingJob = new CronJob (
393
- MEETING_TIME ,
394
- ( ) => {
395
- notify ( parseMeetingMessage ( MEETING_MENTION ) )
396
- . then ( ( ) => console . log ( 'Meeting Job Completed.' ) )
397
- . catch ( HawkCatcher . send ) ;
398
- } ,
399
- null ,
400
- true ,
401
- 'Europe/Moscow'
402
- ) ;
392
+ if ( MEETING_TIME ) {
393
+ const meetingJob = new CronJob (
394
+ MEETING_TIME ,
395
+ ( ) => {
396
+ notify ( parseMeetingMessage ( MEETING_MENTION ) )
397
+ . then ( ( ) => console . log ( 'Meeting Job Completed.' ) )
398
+ . catch ( HawkCatcher . send ) ;
399
+ } ,
400
+ null ,
401
+ true ,
402
+ 'Europe/Moscow'
403
+ ) ;
403
404
404
- const toDoJob = new CronJob (
405
- TO_DO_TIME ,
406
- async ( ) => {
407
- notify (
408
- await notifyMessage ( "📌 Sprint's backlog" , COLUMN_NODE_ID_TO_DO , true )
409
- )
410
- . then ( ( ) => console . log ( 'Tasks Job Completed.' ) )
411
- . catch ( HawkCatcher . send ) ;
412
- } ,
413
- null ,
414
- true ,
415
- 'Europe/Moscow'
416
- ) ;
405
+ meetingJob . start ( ) ;
406
+ console . log ( 'Meeting notifier started' ) ;
407
+ console . log ( 'Will notify at:' + MEETING_TIME ) ;
417
408
418
- const prJob = new CronJob (
419
- PR_TIME ,
420
- async ( ) => {
421
- notify (
422
- await notifyMessage ( '👀 Pull requests for review' , COLUMN_NODE_ID_PR )
423
- )
424
- . then ( ( ) => console . log ( 'PR Job Completed.' ) )
425
- . catch ( HawkCatcher . send ) ;
426
- } ,
427
- null ,
428
- true ,
429
- 'Europe/Moscow'
430
- ) ;
409
+ // notify(parseMeetingMessage(MEETING_MENTION))
410
+ // .then(() => console.log('Meeting Job Completed.'))
411
+ // .catch(HawkCatcher.send);
412
+ }
413
+
414
+ if ( TO_DO_TIME ) {
415
+ const toDoJob = new CronJob (
416
+ TO_DO_TIME ,
417
+ async ( ) => {
418
+ notify (
419
+ await notifyMessage ( "📌 Sprint's backlog" , COLUMN_NODE_ID_TO_DO , true )
420
+ )
421
+ . then ( ( ) => console . log ( 'Tasks Job Completed.' ) )
422
+ . catch ( HawkCatcher . send ) ;
423
+ } ,
424
+ null ,
425
+ true ,
426
+ 'Europe/Moscow'
427
+ ) ;
428
+
429
+ toDoJob . start ( ) ;
430
+ console . log ( 'To do list Notifier started' ) ;
431
+ console . log ( 'Will notify at:' + TO_DO_TIME ) ;
432
+
433
+ // notify(
434
+ // await notifyMessage("📌 Sprint's backlog", COLUMN_NODE_ID_TO_DO, true)
435
+ // )
436
+ // .then(() => console.log('Tasks Job Completed.'))
437
+ // .catch(HawkCatcher.send);
438
+ }
431
439
432
- meetingJob . start ( ) ;
433
- console . log ( 'Meeting notifier started' ) ;
434
- console . log ( 'Will notify at:' + MEETING_TIME ) ;
440
+ if ( PR_TIME ) {
441
+ const prJob = new CronJob (
442
+ PR_TIME ,
443
+ async ( ) => {
444
+ notify (
445
+ await notifyMessage ( '👀 Pull requests for review' , COLUMN_NODE_ID_PR )
446
+ )
447
+ . then ( ( ) => console . log ( 'PR Job Completed.' ) )
448
+ . catch ( HawkCatcher . send ) ;
449
+ } ,
450
+ null ,
451
+ true ,
452
+ 'Europe/Moscow'
453
+ ) ;
435
454
436
- toDoJob . start ( ) ;
437
- console . log ( 'To do list Notifier started' ) ;
438
- console . log ( 'Will notify at:' + TO_DO_TIME ) ;
455
+ prJob . start ( ) ;
456
+ console . log ( 'PR review list Notifier started' ) ;
457
+ console . log ( 'Will notify at:' + PR_TIME ) ;
439
458
440
- prJob . start ( ) ;
441
- console . log ( 'PR review list Notifier started' ) ;
442
- console . log ( 'Will notify at:' + PR_TIME ) ;
459
+ // notify(
460
+ // await notifyMessage('👀 Pull requests for review', COLUMN_NODE_ID_PR)
461
+ // )
462
+ // .then(() => console.log('PR Job Completed.'))
463
+ // .catch(HawkCatcher.send);
464
+ }
443
465
}
444
466
445
467
main ( ) ;
0 commit comments