File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 3030 "require" : {
3131 "php" : " ^8.2" ,
3232 "nunomaduro/termwind" : " ^1.0|^2.0" ,
33- "nutgram/nutgram" : " dev-single-polling-update "
33+ "nutgram/nutgram" : " ^4.20 "
3434 },
3535 "require-dev" : {
3636 "illuminate/testing" : " ^9.0|^10.0|^11.0|^12.0" ,
Original file line number Diff line number Diff line change 88
99class ListenCommand extends Command
1010{
11- protected $ signature = 'nutgram:listen ' ;
11+ protected $ signature = 'nutgram:listen {--pollingTimeout=1} ' ;
1212
1313 protected $ description = 'Start the bot for development and reloads after every update. ' ;
1414
1515 public function handle (): void
1616 {
17+ $ this ->warn ('This running mode is very inefficient and only suitable for development purposes. DO NOT USE IN PRODUCTION! ' );
1718 $ this ->info ('Listening... ' );
19+
20+ $ pollingTimeout = $ this ->option ('pollingTimeout ' ) ?: 1 ;
21+ config ()?->set('nutgram.config.polling.timeout ' , $ pollingTimeout );
1822 while (true ) {
23+ if (function_exists ('opcache_reset ' )) {
24+ opcache_reset ();
25+ }
1926 app ()->forgetInstance (Nutgram::class);
2027 $ bot = app (Nutgram::class);
2128 $ bot ->setRunningMode (SingleUpdate::class);
You can’t perform that action at this time.
0 commit comments