1- import { Command , Positional } from 'nestjs-command' ;
1+ import { Command , Positional } from 'nestjs-command' ;
22import { Injectable } from '@nestjs/common' ;
3- import { BullMqClient } from " @gitroom/nestjs-libraries/bull-mq-transport/client/bull-mq.client" ;
3+ import { BullMqClient } from ' @gitroom/nestjs-libraries/bull-mq-transport-new /client' ;
44
55@Injectable ( )
66export class CheckStars {
7- constructor (
8- private _workerServiceProducer : BullMqClient
9- ) {
10- }
11- @Command ( {
12- command : 'sync:stars <login>' ,
13- describe : 'Sync stars for a login' ,
7+ constructor ( private _workerServiceProducer : BullMqClient ) { }
8+ @Command ( {
9+ command : 'sync:stars <login>' ,
10+ describe : 'Sync stars for a login' ,
11+ } )
12+ async create (
13+ @Positional ( {
14+ name : 'login' ,
15+ describe : 'login {owner}/{repo}' ,
16+ type : 'string' ,
1417 } )
15- async create (
16- @Positional ( {
17- name : 'login' ,
18- describe : 'login {owner}/{repo}' ,
19- type : 'string'
20- } )
21- login : string ,
22- ) {
23- this . _workerServiceProducer . emit ( 'check_stars' , { payload : { login} } ) . subscribe ( ) ;
24- return true ;
25- }
18+ login : string
19+ ) {
20+ this . _workerServiceProducer
21+ . emit ( 'check_stars' , { payload : { login } } )
22+ . subscribe ( ) ;
23+ return true ;
24+ }
2625
27- @Command ( {
28- command : 'sync:all_stars <login>' ,
29- describe : 'Sync all stars for a login' ,
26+ @Command ( {
27+ command : 'sync:all_stars <login>' ,
28+ describe : 'Sync all stars for a login' ,
29+ } )
30+ async syncAllStars (
31+ @Positional ( {
32+ name : 'login' ,
33+ describe : 'login {owner}/{repo}' ,
34+ type : 'string' ,
3035 } )
31- async syncAllStars (
32- @Positional ( {
33- name : 'login' ,
34- describe : 'login {owner}/{repo}' ,
35- type : 'string'
36- } )
37- login : string ,
38- ) {
39- this . _workerServiceProducer . emit ( 'sync_all_stars' , { payload : { login} } ) . subscribe ( ) ;
40- return true ;
41- }
36+ login : string
37+ ) {
38+ this . _workerServiceProducer
39+ . emit ( 'sync_all_stars' , { payload : { login } } )
40+ . subscribe ( ) ;
41+ return true ;
42+ }
4243
43- @Command ( {
44- command : 'sync:trending' ,
45- describe : 'Sync trending' ,
46- } )
47- async syncTrending ( ) {
48- this . _workerServiceProducer . emit ( 'sync_trending' , { } ) . subscribe ( ) ;
49- return true ;
50- }
51- }
44+ @Command ( {
45+ command : 'sync:trending' ,
46+ describe : 'Sync trending' ,
47+ } )
48+ async syncTrending ( ) {
49+ this . _workerServiceProducer . emit ( 'sync_trending' , { } ) . subscribe ( ) ;
50+ return true ;
51+ }
52+ }
0 commit comments