Git Product home page Git Product logo

Comments (3)

Electroid avatar Electroid commented on June 12, 2024 1

We should probably cancel timers on --hot reload.

from bun.

ComputMagnac avatar ComputMagnac commented on June 12, 2024

For anyone using --hot as of today, you can use a simple looping alternative:

console.log(`Program started`, Date.now())
intervalFunction(); 

function intervalFunction()
{
    console.log("Hello World !");
    await new Promise(resolve => setTimeout(resolve, 1000))
    return await intervalFunction();
}

from bun.

ComputMagnac avatar ComputMagnac commented on June 12, 2024

Update, it appears that the issue occurs on setInterval.

/*
[DEBUG] Loading new schedule : _schedules/paidProductsDisabler with interval of 1000
[DEBUG] Controller Executed at 1708544326475
[2] Billing status: 1 | Days Left: 17.86 | Failed Days Left: null 
[4] Billing status: 3 | Days Left: 17.87 | Failed Days Left: null 
[DEBUG] Controller Executed at 1708544326479
[2] Billing status: 1 | Days Left: 17.86 | Failed Days Left: null 
[4] Billing status: 3 | Days Left: 17.87 | Failed Days Left: null 
[DEBUG] Controller Executed at 1708544326482
[2] Billing status: 1 | Days Left: 17.86 | Failed Days Left: null 
[4] Billing status: 3 | Days Left: 17.87 | Failed Days Left: null 
[DEBUG] Controller Executed at 1708544326485
[2] Billing status: 1 | Days Left: 17.86 | Failed Days Left: null 
[4] Billing status: 3 | Days Left: 17.87 | Failed Days Left: null 
One is supposed to arrive
*/

console.log(`Entering loading Schedules [Total: ${this.#schedules.length} schedules]`);
for (let schedule of this.#schedules)
{
    console.log(`[DEBUG] Loading new schedule : ${schedule.controller} with interval of ${schedule.interval}`);
    setTimeout(() => {
        let res = new ResponseBuilder(this.#directory, "");
        return res.loadController(schedule.controller, { 
            models: this.#models
        }, res)
    }, schedule.interval);
}

from bun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.