You are reading a single comment by @Gordon and its replies.
Click here to read the full conversation.
-
Oh... thanks for both the tips. I'll remove the redundant lock.
@Gordon reference to your comment about the global
AppLog
namespace making python script easier, absolutely. I am planning to move the code forsync
into another function in AppLog namespace. That way I'll have a little more control when I introduce compression and send back data uncompressed. I'll wait for your suggestions on compression.
Actually that's one of the nice bits about JS. While code can be async, it all runs in the same thread - so if you do everything in one function (like you have done for
clearLog
) then you can be confident that nothing else will be running at the same time and causing you issues :)edit: Compression (if you use heatshrink) may cause you some issues - since it'll use char code 255 which isn't allowed in StorageFile... I'll just post some comments on http://forum.espruino.com/conversations/344144/#comment15122336 where you mentioned the filesize