MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MM module loading stale data??

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    1 Posts 1 Posters 626 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      makerofmirror12
      last edited by

      I have a node helper file that is doing this:

      const NodeHelper = require("node_helper");
      const fs= require("fs");
      
      module.exports = NodeHelper.create({
      //here comes the part of the nodehelper after the 3 dots as posted above
      
              socketNotificationReceived: function(notification, payload) {
                      if(notification === "START"){
                              this.config = payload;
                              this.readData();
                              setInterval(() => {
                                      this.readData();
                              }, this.config.updateInterval);
                      }
              },
      
      
              readData: function (){
              //to read a file to do the following
                      fs.readFile('/container.html', 'utf8', (err, data) => {
                      if (err) throw err;
                      this.sendSocketNotification('DATA', data);
                      });
              }
      })
      
      

      This seems to present the same info… despite changing what it is in the file: container.html

      Why is that? Isn’t think loading up on every npm start?

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Sam, technical setup by Karsten.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy