有时您想执行长时间运行的函数,并且不想等待响应。 Cloud Jobs
就是为此而生的。
创新互联公司专注于招远企业网站建设,成都响应式网站建设公司,商城网站制作。招远网站建设公司,为招远等地区提供建站服务。全流程按需制作,专业设计,全程项目跟踪,创新互联公司专业和态度为您提供的服务
在您的云功能中定义Job。
Moralis.Cloud.job("myJob", (request) => {
// params: passed in the job call
// headers: from the request that triggered the job
// log: the Moralis Server logger passed in the request
// message: a function to update the status message of the job object
const { params, headers, log, message } = request;
message("I just started");
return doSomethingVeryLong(request);
});
您可以通过单击右上角的“Schedule a job”在仪表板的“Jobs”部分安排Job。
选择描述、要运行的Job并在需要时提供参数
当您配置好您的工作后,您可以通过按右下角的“Schedule”来确认它。