@@ -7,15 +7,14 @@ export class ActionExecutorBase extends ContentFeature {
77 /**
88 * @param {any } action
99 * @param {Record<string, any> } data
10- * @param {any } retryConfig
1110 */
12- async processActionAndNotify ( action , data , retryConfig ) {
11+ async processActionAndNotify ( action , data ) {
1312 try {
1413 if ( ! action ) {
1514 return this . messaging . notify ( 'actionError' , { error : 'No action found.' } ) ;
1615 }
1716
18- const { results, exceptions } = await this . exec ( action , data , retryConfig ) ;
17+ const { results, exceptions } = await this . exec ( action , data ) ;
1918
2019 if ( results ) {
2120 // there might only be a single result.
@@ -51,10 +50,10 @@ export class ActionExecutorBase extends ContentFeature {
5150 * later analysis
5251 * @param {any } action
5352 * @param {Record<string, any> } data
54- * @param {any } retryConfig
5553 * @return {Promise<{results: ActionResponse[], exceptions: string[]}> }
5654 */
57- async exec ( action , data , retryConfig ) {
55+ async exec ( action , data ) {
56+ const retryConfig = this . retryConfigFor ( action ) ;
5857 const { result, exceptions } = await retry ( ( ) => execute ( action , data , document ) , retryConfig ) ;
5958
6059 if ( result ) {
@@ -63,7 +62,7 @@ export class ActionExecutorBase extends ContentFeature {
6362 const nextExceptions = [ ] ;
6463
6564 for ( const nextAction of result . success . next ) {
66- const { results : subResults , exceptions : subExceptions } = await this . exec ( nextAction , data , retryConfig ) ;
65+ const { results : subResults , exceptions : subExceptions } = await this . exec ( nextAction , data ) ;
6766
6867 nextResults . push ( ...subResults ) ;
6968 nextExceptions . push ( ...subExceptions ) ;
@@ -74,6 +73,13 @@ export class ActionExecutorBase extends ContentFeature {
7473 }
7574 return { results : [ ] , exceptions } ;
7675 }
76+
77+ /**
78+ * @returns {any }
79+ */
80+ retryConfigFor ( action ) {
81+ this . log . error ( 'unimplemented method: retryConfigFor:' , action ) ;
82+ }
7783}
7884
7985/**
@@ -83,7 +89,7 @@ export default class BrokerProtection extends ActionExecutorBase {
8389 init ( ) {
8490 this . messaging . subscribe ( 'onActionReceived' , async ( /** @type {any } */ params ) => {
8591 const { action, data } = params . state ;
86- return await this . processActionAndNotify ( action , data , this . retryConfigFor ( action ) ) ;
92+ return await this . processActionAndNotify ( action , data ) ;
8793 } ) ;
8894 }
8995
0 commit comments