本文整理汇总了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);
}
}