Persistent context storage

Hi everyone,
What a really great feature!
I put this into my settings.js file, I only need it to update every 10 minutes.
I wish there was more info on this.
A couple of questions for you.....

  1. Have I done it correctly?
  2. Does it only flush if there has been an update or is it as per the flushInterval irrespective?

If it's only if there has been an update, I can reduce the flushInterval back to 30 seconds.

The way I understand it is:

This will use memory:
var hb_counter = context.get("c_hb_counter") || 0;
context.set("c_hb_counter", hb_counter);

This will use file:
var overfly_array = flow.get("c_overfly_array", "disk") || ;
flow.set("c_overfly_array", overfly_array, "disk");

Am I correct? :thinking:

Christmas is coming!! :christmas_tree:

Cheers. :beers:
Paul.

    contextStorage: {
        default: {
            module:"memory"
        },
        disk: {
            module:"localfilesystem", config:{flushInterval: 600}
        },
    },

See this post by Nick...

1 Like

Almost there! you are missing quotes around the flush interval time, and also the comma after the brace.

    contextStorage: {
        default: {
        module: 'memory'
        },
        disk: {
           module: 'localfilesystem', config: {flushInterval: '600'},
          },
     },
1 Like

This thread might also be helpful to you A guide to understanding ‘Persistent Context’

2 Likes

Hi Paul-Reed,
Thank you!

Cheers.
Paul

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.