File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,26 @@ export class DefaultOdpManager extends BaseService implements OdpManager {
125
125
}
126
126
127
127
stop ( ) : void {
128
- // if (this.status === Status.Stopped) {
129
- // return;
130
- // }
131
- // this.status = Status.Stopped;
132
- // await this.eventManager.stop();
128
+ if ( this . isDone ( ) ) {
129
+ return ;
130
+ }
131
+
132
+ if ( this . isNew ( ) ) {
133
+ this . startPromise . reject ( new Error ( 'odp manager stopped before starting' ) ) ;
134
+ this . stopPromise . resolve ( ) ;
135
+ return ;
136
+ }
137
+
138
+ this . state = ServiceState . Stopping ;
139
+ this . eventManager . stop ( ) ;
140
+
141
+ this . eventManager . onTerminated ( ) . then ( ( ) => {
142
+ this . state = ServiceState . Terminated ;
143
+ this . stopPromise . resolve ( ) ;
144
+ } ) . catch ( ( err ) => {
145
+ this . state = ServiceState . Failed ;
146
+ this . stopPromise . reject ( err ) ;
147
+ } ) ;
133
148
}
134
149
135
150
updateConfig ( odpIntegrationConfig : OdpIntegrationConfig ) : boolean {
You can’t perform that action at this time.
0 commit comments