File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Repete uma mensagem em um determinado período de tempo. Cada mensagem é repres
13
13
\`\`\`--stop\`\`\` -> _para uma thread._
14
14
\`\`\`--start\`\`\` -> _inicia uma thread._
15
15
\`\`\`--log\`\`\` -> _mostra as threads existentes._
16
+ \`\`\`--killall\`\`\` -> _para e apaga todas as threads._
16
17
\`\`\`--help\`\`\` -> _mostra esta mensagem._
17
18
18
19
*kwargs válidos:*
@@ -124,6 +125,14 @@ class Cron {
124
125
return output . trim ( ) ;
125
126
}
126
127
128
+ killall ( ) {
129
+ this . threads . forEach ( ( t ) => {
130
+ this . destroy ( t . id ) ;
131
+ } ) ;
132
+
133
+ return 'Todas as threads foram destruidas.' ;
134
+ }
135
+
127
136
runs ( data , message ) {
128
137
const methods = {
129
138
log : ( ) => this . log ( ) ,
@@ -132,6 +141,7 @@ class Cron {
132
141
start : ( ) => this . start ( data . text ) ,
133
142
stop : ( ) => this . stop ( data . text ) ,
134
143
help : ( ) => this . strings . help ,
144
+ killall : ( ) => this . killall ( ) ,
135
145
} ;
136
146
137
147
if ( methods [ data . args [ 0 ] ] ) {
You can’t perform that action at this time.
0 commit comments