本文整理匯總了TypeScript中azure-arm-rest/azure-arm-app-service-kudu.Kudu.getProcess方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Kudu.getProcess方法的具體用法?TypeScript Kudu.getProcess怎麽用?TypeScript Kudu.getProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類azure-arm-rest/azure-arm-app-service-kudu.Kudu
的用法示例。
在下文中一共展示了Kudu.getProcess方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: restart
public async restart() {
try {
console.log(tl.loc('RestartingKuduService'));
var process0 = await this._appServiceKuduService.getProcess(0);
tl.debug(`Process 0 ID: ${process0.id}`);
await this._appServiceKuduService.killProcess(0);
await this._pollForNewProcess(0, process0.id);
console.log(tl.loc('RestartedKuduService'));
}
catch(error) {
throw Error(tl.loc('FailedToRestartKuduService', error.toString()));
}
}
示例2: _pollForNewProcess
private async _pollForNewProcess(processID: number, id: number) {
var retryCount = 6;
while(true) {
try {
var process = await this._appServiceKuduService.getProcess(processID);
tl.debug(`process ${processID} ID: ${process.id}`);
if(process.id != id) {
tl.debug(`New Process created`);
return process;
}
}
catch(error) {
tl.debug(`error while polling for process ${processID}: ` + error.toString());
}
retryCount -= 1;
if(retryCount == 0) {
throw new Error(tl.loc('TimeoutWhileWaiting'));
}
tl.debug(`sleep for 5 seconds`)
await webClient.sleepFor(5);
}
}