成都网站建设设计

将想法与焦点和您一起共享

创新互联Moralis教程:MoralisJobs

有时您想执行长时间运行的函数,并且不想等待响应。 ​Cloud Jobs​ 就是为此而生的。

创新互联公司专注于招远企业网站建设,成都响应式网站建设公司,商城网站制作。招远网站建设公司,为招远等地区提供建站服务。全流程按需制作,专业设计,全程项目跟踪,创新互联公司专业和态度为您提供的服务

定义一个Job

在您的云功能中定义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);
    });

安排Job

您可以通过单击右上角的“Schedule a job”在仪表板的“Jobs”部分安排Job。

选择描述、要运行的Job并在需要时提供参数

当您配置好您的工作后,您可以通过按右下角的“Schedule”来确认它。


分享文章:创新互联Moralis教程:MoralisJobs
URL网址:http://chengdu.cdxwcx.cn/article/ccioops.html