File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Total.js Builders
22// The MIT License
3- // Copyright 2023 (c) Peter Širka <petersirka@gmail.com>
3+ // Copyright 2023-2026 (c) Peter Širka <petersirka@gmail.com>
44
55'use strict' ;
66
@@ -1405,6 +1405,7 @@ ActionCaller.prototype.exec = function() {
14051405 let type = meta . payload || ( action . input ? '+' : '-' ) ;
14061406 let $ = self . $ ;
14071407
1408+ $ . $end = false ;
14081409 $ . name = action . name ;
14091410 $ . id = action . id ;
14101411 $ . error = self . error ;
@@ -1416,6 +1417,16 @@ ActionCaller.prototype.exec = function() {
14161417
14171418 $ . $callback = function ( err , response ) {
14181419
1420+ if ( $ . $end )
1421+ return ;
1422+
1423+ $ . $end = true ;
1424+
1425+ if ( $ . $timeout ) {
1426+ clearTimeout ( $ . $timeout ) ;
1427+ $ . $timeout = null ;
1428+ }
1429+
14191430 if ( ! err ) {
14201431 if ( action . jsoutput )
14211432 response = action . jsoutput . transform ( response ) . response ;
@@ -1514,6 +1525,12 @@ ActionCaller.prototype.exec = function() {
15141525 if ( self . options . progress )
15151526 $ . progress2 = self . options . progress ;
15161527
1528+ if ( action . timeout ) {
1529+ $ . $timeout = setTimeout ( function ( ) {
1530+ $ . invalid ( 'Timeout.' ) ;
1531+ } , action . timeout ) ;
1532+ }
1533+
15171534 if ( action . middleware ) {
15181535 action . middleware . wait ( function ( name , next ) {
15191536 let fn = F . routes . middleware [ name ] ;
Original file line number Diff line number Diff line change 2424- added a new global methods `AIMODEL()` and `NEWAIMODEL()`
2525- added `exec` command to the remote editing functionality
2626- always set `cwd` directory for the current executed script
27+ - added `timeout {Number}` property into the `NEWACTION` method
2728
2829========================
29300.0.15
You can’t perform that action at this time.
0 commit comments