Right now I'm just having the Python script overwrite the .json file.
Problem is, it doesn't seem like this is enough. In my tests, when the door requests data from the json service, the data it gets is old.
So do I need to make my Python script somehow tell Synchronet to re-fetch the data from the .json file once it has written a new version? If so, how do I do this?
I believe that the JSON service only reads from that file when loading a DB module (which happens when the service is started/restarted, possibly when
a given module is reloaded via json-svc-ctrl.js.)
I'd like to do this reloading on demand (I only scrape new data once or twice an hour), rather than have a script constantly running. So tonight I'm going to see if I can pull some of the bits from json-svc-ctrl.js into a new script that I could call from the command line to reload sportsstats json data.
Overwriting the .json file will probably work. The sequence of events will be important. I imagine it'll be fine if you "close" the DB module, overwrite the file, then reload the DB module.
"!JavaScript : uncaught exception: User not found: [object Object]"
var user = '[removed]';
var pass = '[removed]';
db.ident('ADMIN',user,pass);
Just to be sure, your actual username & password aren't wrapped in [], are they? If they are, the JSON service may be treating them as arrays and failing to find a match.
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 139:58:53 |
Calls: | 369 |
Files: | 2 |
Messages: | 38,441 |