Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public start(callback: (err?: Error) => void) {
debugLog("RegisterServerManager#start");
if (this.state !== RegisterServerManagerStatus.INACTIVE) {
return callback(new Error("RegisterServer process already started")); // already started
}
this.discoveryServerEndpointUrl = resolveFullyQualifiedDomainName(this.discoveryServerEndpointUrl);
// perform initial registration + automatic renewal
this._establish_initial_connection((err?: Error) => {
if (err) {
debugLog("RegisterServerManager#start => _establish_initial_connection has failed");
return callback(err);
}
this._setState(RegisterServerManagerStatus.REGISTERING);
this._registerServer(true, (err1?: Error) => {
if (this.state !== RegisterServerManagerStatus.REGISTERING) {
debugLog("RegisterServerManager#start )=> Registration has been cancelled");
return callback(new Error("Registration has been cancelled"));
(endpoint as any).__defineGetter__("endpointUrl", () => {
return resolveFullyQualifiedDomainName(options.endpointUrl);
});
(endpoint as any).__defineGetter__("endpointUrl", () => {
return resolveFullyQualifiedDomainName(options.endpointUrl);
});