Track client connections and autostop server add-ons when all clients leave
Reviewed By: mweststrate Differential Revision: D34045584 fbshipit-source-id: 1ad0cfffb9d304f0359c973d76d6956f7e932f72
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9113006851
commit
3b390b74ff
@@ -101,8 +101,13 @@ export class SandyDevicePluginInstance extends BasePluginInstance {
|
||||
private startServerAddOn() {
|
||||
const {serverAddOn, name} = this.definition.details;
|
||||
if (serverAddOn) {
|
||||
this.serverAddOnControls.start(name).catch((e) => {
|
||||
console.warn('Failed to start a server add on', name, e);
|
||||
this.serverAddOnControls.start(name, this.device.serial).catch((e) => {
|
||||
console.warn(
|
||||
'Failed to start a server add on',
|
||||
name,
|
||||
this.device.serial,
|
||||
e,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -110,8 +115,13 @@ export class SandyDevicePluginInstance extends BasePluginInstance {
|
||||
private stopServerAddOn() {
|
||||
const {serverAddOn, name} = this.definition.details;
|
||||
if (serverAddOn) {
|
||||
this.serverAddOnControls.stop(name).catch((e) => {
|
||||
console.warn('Failed to start a server add on', name, e);
|
||||
this.serverAddOnControls.stop(name, this.device.serial).catch((e) => {
|
||||
console.warn(
|
||||
'Failed to start a server add on',
|
||||
name,
|
||||
this.device.serial,
|
||||
e,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user