提交 be09bb70 编写于 作者: G Gloria 提交者: wusongqing

fixed bb125569 from https://gitee.com/wusongqing/docs/pulls/17783

Update docs against 16863

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 14ae7feb
...@@ -59,6 +59,7 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops. ...@@ -59,6 +59,7 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
``` ```
Import the **WorkSchedulerExtensionAbility** module. Import the **WorkSchedulerExtensionAbility** module.
```js ```js
import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility'; import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility';
``` ```
...@@ -78,7 +79,6 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops. ...@@ -78,7 +79,6 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
} }
``` ```
3. Start a Work Scheduler task. 3. Start a Work Scheduler task.
```ts ```ts
...@@ -106,7 +106,6 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops. ...@@ -106,7 +106,6 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
} }
``` ```
4. Stop the Work Scheduler task. 4. Stop the Work Scheduler task.
```ts ```ts
...@@ -132,10 +131,8 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops. ...@@ -132,10 +131,8 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
} catch (error) { } catch (error) {
console.error(`workschedulerLog stopWork failed. code is ${error.code} message is ${error.message}`); console.error(`workschedulerLog stopWork failed. code is ${error.code} message is ${error.message}`);
} }
``` ```
5. Obtain a specified Work Scheduler task. 5. Obtain a specified Work Scheduler task.
```ts ```ts
...@@ -187,7 +184,7 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops. ...@@ -187,7 +184,7 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
try{ try{
workScheduler.isLastWorkTimeOut(500, (error, res) =>{ workScheduler.isLastWorkTimeOut(500, (error, res) =>{
if (error) { if (error) {
onsole.error(`workschedulerLog isLastWorkTimeOut failed. code is ${error.code} message is ${error.message}`); console.error(`workschedulerLog isLastWorkTimeOut failed. code is ${error.code} message is ${error.message}`);
} else { } else {
console.info(`workschedulerLog isLastWorkTimeOut success, data is: ${res}`); console.info(`workschedulerLog isLastWorkTimeOut success, data is: ${res}`);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册