# Context not updating on localfilesystem

**URL:** <https://discourse.nodered.org/t/context-not-updating-on-localfilesystem/17586>\
**Category:** General\
**Created:** [6 November 2019 11:43 UTC](https://discourse.nodered.org/t/context-not-updating-on-localfilesystem/17586 "2019-11-06T11:43:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rholmesa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rholmesa/32/29252_2.png) [@rholmesa](https://discourse.nodered.org/u/rholmesa)\
**Post date:** [6 November 2019 11:43 UTC](https://discourse.nodered.org/t/context-not-updating-on-localfilesystem/17586/1 "2019-11-06T11:43:19Z")

</div>

I hope as ever that I have not done something stupid but here goes ...

Raspberry pi running node-red 0.20.7. I have set up Global Context storage to 'localfilesystem'

```auto
contextStorage: {
       default: {
           module:"localfilesystem"
       },
    },

```

in settings.js.

The relevant directory structure has been created and I can see the data stored in global.json. An extract is as follows:

```auto
{
    "stats": {
        "devices": [
            {
                "name": "Room Left",
                "address": "X10_DOOR/0X0B0466",
                "value": "Normal",
                "date": "08/10/2019",
                "time": "16:03:33",
                "visible": true
            },

```

But as you can see from the date (UK) - it is not being updated.

I know the global itself is updated as I use it for a status displays via MQTT requests, and the latest date should be today. If I re-boot the pi - the data I get is this out of date version.

Any ideas where I should look for the problem?

Regards

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 November 2019 13:26 UTC](https://discourse.nodered.org/t/context-not-updating-on-localfilesystem/17586/2 "2019-11-06T13:26:09Z")

</div>

How are you changing the date? how/when are you storing the global?

The persistant data will only change when you set it to something new.

can you [provide your flow](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) and indicate what node is updating the persistant data?

---

<div class="post-metadata">

**Author:** ![rholmesa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rholmesa/32/29252_2.png) [@rholmesa](https://discourse.nodered.org/u/rholmesa)\
**Post date:** [6 November 2019 14:03 UTC](https://discourse.nodered.org/t/context-not-updating-on-localfilesystem/17586/3 "2019-11-06T14:03:42Z")

</div>

OK - it was me!🤪

Thanks @zenofmud for making me review it with fresh thoughts.👍

I am using my own js routines to update the global context data. Since I could see the values being updated, it never occurred to me that I should also use global.set() to ensure that the context data is refreshed.

I added a global.set() to the function node - et voila!!
