Logic Machine Forum
storage.get()/storage.set() - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: storage.get()/storage.set() (/showthread.php?tid=2146)



storage.get()/storage.set() - benanderson_475 - 09.07.2019

Hi, 

What the limitations of the storage.set() / storage.get() functions are?

Im trying to work out how much I can use before I break it... what is it’s capacity and where dose it actually store its information and how many times can this be stored/written? 

And what happens on power fail/ reboot are these values kept or lost?

Many Thanks


RE: storage.get()/storage.set() - admin - 09.07.2019

Storage is kept in memory and is flushed to disk every 30 minutes. What kind of data do you want to store there?


RE: storage.get()/storage.set() - benanderson_475 - 09.07.2019

Thanks, mainly I want to store lua table and some other global variables, for use later on  etc, is there any limitations to how many times This function can be called? And how much memory is available? Is there some other way to make global lua table persistent?  
Many thanks


RE: storage.get()/storage.set() - admin - 09.07.2019

There's no call limit. There's a memory limit but I doubt that your tables will be big enough to use a lot of it.

One thing to consider with tables in storage is that you might get race conditions when several scripts want to modify table data. If you don't need tables with multiple levels then built-in Redis hash functions can be used instead.

Right now it's hard to offer the best solution because I don't know what task do you have.