Skip to content

fix(sdk): fix auto_clear_time conversion and wait_interval boundary #882#883

Merged
zhongwen666 merged 1 commit intoalibaba:masterfrom
zhongwen666:fix/auto_clear_time_conversion_0422
Apr 22, 2026
Merged

fix(sdk): fix auto_clear_time conversion and wait_interval boundary #882#883
zhongwen666 merged 1 commit intoalibaba:masterfrom
zhongwen666:fix/auto_clear_time_conversion_0422

Conversation

@zhongwen666
Copy link
Copy Markdown
Collaborator

改动功能点

  • 修复 auto_clear_time 从秒转分钟时产生浮点数的问题,改为向上取整为整数
  • 修复 wait_for_process()wait_interval 可能大于 auto_clear_seconds 导致沙箱在轮询前被清除的问题

代码改动点

  • rock/sdk/sandbox/client.py: 新增 import math
  • rock/sdk/sandbox/client.py:171-172: auto_clear_timeauto_clear_time_minutesauto_clear_seconds / 60 改为 int(math.ceil(auto_clear_seconds / 60)),确保传给服务端的值为整数分钟且向上取整
  • rock/sdk/sandbox/client.py:641: 在 wait_for_process() 中增加 wait_interval = min(self.config.auto_clear_seconds - 2, wait_interval),确保轮询间隔小于自动清理时间

关联 Issue

refs #882

@zhongwen666 zhongwen666 merged commit 2ac1714 into alibaba:master Apr 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants