【发布时间】:2020-12-21 16:20:07
【问题描述】:
假设一个服务器
const Apify = require("apify");
const express = require("express");
const app = express();
app.get("/run", async (_, res) => {
Apify.main(async () => {
// Let the actor run for an hour.
await Apify.utils.sleep(60 * 60 * 1000);
});
res.redirect("/");
});
app.get("/state", async (req, res) => {
const pageHtml = `
<html>
<head><title>Example</title></head>
<body>
<pre>${JSON.stringify(Apify.utils.log)}</pre>
</body>
</html>
`;
res.send(pageHtml);
});
app.listen(3000, () => {
console.log(`Application is listening at URL ${APIFY_CONTAINER_URL}.`);
});
除了 express 和 apify 工作之外,它什么都不做。
如何获取Apify 的状态?
我需要知道
- 现在有工作演员吗?
- 有睡眠状态吗?
- Apify 现在的主要状态是什么?
没有 Apify 云。
【问题讨论】: