The below code works perfectly on page, however, when i move it too run as Backend code so i can schedule it it fails after 14s and gives “WebMethod request timed-out after 14 seconds… Did you forget to resolve a promise?” Why is it ok on page code where I had it run 150 consecutive requests, in the backend code it gets to the 8th ish call and fails for the 14s code rule.
import wixData from ‘wix-data’;
import { fetch } from ‘wix-fetch’;
export async function asyncgetfcainfo(fcanumber) {
const url = ‘MyURL/’ + fcanumber;
const response = await fetch(url, {
method: “get”
});
return await response.json();
}
export async function NewFRNDataQuery() {
const results = await wixData.query(“NewFRNData”).limit(150).find();
if (results.items.length > 0) {
let item = results.items;
let totalCount = results.length;
console.log(results);
var j = 0;
var frnarray = ;
for ( var i = 0; i < totalCount; i++) {
console.log(results.items[i].frn);
const fcainfo = await asyncgetfcainfo(results.items[i].frn);
console.log(fcainfo);
frnarray.push(fcainfo);
}}}