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

187
Views
Vue.js cómo hacer que Axios GET y POST soliciten cada 5 minutos

Estoy tratando de recibir una solicitud GET de Axios cada 5 minutos, en mi .luego, en la solicitud GET de Axios, analizo los datos y luego los POSTO en una solicitud Axios anidada. Sin embargo, la solicitud POST se activa antes de la marca de 5 minutos. Intenté tenerlos como dos setIntervals separados, pero tampoco funcionó para mí. ¿Alguien tiene alguna sugerencia y sabe por qué se activa el POST antes de que transcurran los 5 minutos?

 setInterval(() => { let uri = 'https://prices.runescape.wiki/api/v1/osrs/5m' axios.get(uri).then(response => { console.log(response.data) this.prices = response.data.data; this.timestamp = response.data.timestamp for(const index in this.prices){ this.fiveMinPrice = { "id": index, "avgHighPrice": this.prices[index].avgHighPrice, "avgLowPrice": this.prices[index].avgLowPrice, "highPriceVolume": this.prices[index].highPriceVolume, "lowPriceVolume": this.prices[index].lowPriceVolume, "timestamp": this.timestamp } this.fiveMinPrices.push(this.fiveMinPrice) } let url = '/api/5m/' axios.post(url, this.fiveMinPrices).then(response => { console.log(response) }).catch(function(error){ console.log(error) }) }).catch(function(error){ console.log(error) }) this.fiveMinPrices = [] this.prices = [] this.fiveMinPrice = {} this.timestamp = 0 }, 300000);
about 4 years ago · Juan Pablo Isaza
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!