如何减少定期工作请求的最小间隔?
How can I reduce the minimum interval for periodic work requests?
我知道从 WorkManager
请求定期工作时的最短间隔为 15 分钟,我理解这样做的原因。
然而,出于调试目的,当我想测试一些工作的安排方式时 运行,不得不等待 15 分钟才能看到非常烦人结果。对于某些调试任务,特别是需要检查 WorkManager
的行为时,似乎无法使用警报服务等变通方法。
那么有没有可能暂时绕过最小周期间隔进行调试?
So is there a possibility to get around the minimum periodic interval only temporarily for debugging?
不,因为那时开发人员会出于任何原因使用它。
it is extremely annoying to have to wait for 15 minutes to see the results
或者,写instrumented tests of your Worker
。
或者,让您的 Worker
成为包含实际业务逻辑的一些其他代码的非常薄的包装器。 periodic aspect使用Worker
,调试时直接使用wrapped code(比如临时hook up到Button
)。
我知道从 WorkManager
请求定期工作时的最短间隔为 15 分钟,我理解这样做的原因。
然而,出于调试目的,当我想测试一些工作的安排方式时 运行,不得不等待 15 分钟才能看到非常烦人结果。对于某些调试任务,特别是需要检查 WorkManager
的行为时,似乎无法使用警报服务等变通方法。
那么有没有可能暂时绕过最小周期间隔进行调试?
So is there a possibility to get around the minimum periodic interval only temporarily for debugging?
不,因为那时开发人员会出于任何原因使用它。
it is extremely annoying to have to wait for 15 minutes to see the results
或者,写instrumented tests of your Worker
。
或者,让您的 Worker
成为包含实际业务逻辑的一些其他代码的非常薄的包装器。 periodic aspect使用Worker
,调试时直接使用wrapped code(比如临时hook up到Button
)。