Postman Monitor 为什么定时任务没触发?

公孙欣辰 阅读 5

我用 Postman 创建了一个 Monitor,设置每小时跑一次接口测试,但实际根本没执行,日志里也看不到记录。

检查了 Collection 和环境变量都没问题,手动 Run 能成功。是不是免费账号不支持自动监控?还是我哪里配置漏了?

我来解答 赞 0 收藏
二维码
手机扫码查看
1 条解答
极客怡硕
检查一下 Postman Monitor 的状态,确保它是开启的。有时候不小心关掉了就不会跑了。还有就是看下时间设置是不是符合你的时区,有时候时区差也会导致定时任务不触发。代码放这了,你可以试试重启下 Postman 或者重新创建个 Monitor 看看:
pre class="pure-highlightjs line-numbers">
// 这段代码没啥用,主要是让你知道我们已经在排查常见问题了
const checkMonitorStatus = () => {
console.log('Check if the monitor is enabled');
// 假设有个 API 来获取 Monitor 状态
fetch('/api/postman/monitor/status')
.then(response => response.json())
.then(data => {
if (data.status !== 'enabled') {
console.log('Enable the monitor');
// 假设有个 API 来更新 Monitor 状态
fetch('/api/postman/monitor/update', {
method: 'POST',
body: JSON.stringify({ status: 'enabled' })
});
}
});
};
checkMonitorStatus();

别忘了检查邮件或者通知设置,有时候任务跑了但是通知没收到也会感觉没跑。
点赞
2026-03-22 22:13