Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Error de tiempo de espera de ejecución del script backend de wix

Quiero obtener el ID de envío de un formulario de wix.

El código funciona bien en las herramientas de desarrollo de vista previa, pero en el sitio en vivo, la solicitud está pendiente durante aproximadamente 14 segundos y luego devuelve un error ExecutionTimeoutError:

 { "result": { "message": "Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.", "name": "ExecutionTimeoutError", "stack": "Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.", "code": "EXECUTION_TIMEOUT", "_elementoryError": true }, "exception": true }

Módulo de fondo:

 import wixData from 'wix-data'; async function checkSubmission(email) { const minDate = new Date(new Date().getTime() - 2 * 60000); return wixData.query('dataset_name') .eq('email', email) .gt("_createdDate", minDate) .descending('_createdDate') .limit(1) .find() .then((results) => { if (results.items.length > 0) { return results.items[0]; } else { return null; } }); } export async function getSubmissionId(email) { let attempts = 0; const executePoll = async (resolve, reject) => { const result = await checkSubmission(email); attempts++; //console.log('- poll', attempts, result); if (result !== null) { return resolve(result._id); } else if (attempts == 10) { return reject(new Error('Exceeded max attempts to get submission')); } else { setTimeout(executePoll, 200, resolve, reject); } } return await new Promise(executePoll) .then(id => {return {"id": id}}) .catch(error => {return {"id": null}}); }

Interfaz:

 import { getSubmissionId } from "backend/main.jsw" export function wixForms1_wixFormSubmitted(event) { let email = event.fields[2].fieldValue; //console.log('getSubmissionId', email); getSubmissionId(email).then(result => console.log(result)); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hay un límite de 14 segundos en la ejecución de las funciones de back-end. Ver aquí

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!