Reputation: 1546
To clean my database, I try to schedule a task. But I wind up in a path spaghetti.
I have a modules database with /src/scheduled/cleanData.sjs
This script contains require("cleanDataLib.xqy");
The scheduled task points to:
/cleanData.sjs
/scheduled
project-content
project-modules
Now, the SJS script cannot find the cleanDataLib.xqy
as stated in the require
.
I am clueless as to where the SJS scipt is running from now. The task path? The modules database? The SJS script location?
Running the SJS from the query console works fine, then the XQY is used and no errors appear.
Error from log:
TaskServer: XDMP-MODNOTFOUND: var cleaner = require("cleanDataLib.xqy"); -- Module cleanDataLib.xqy not found
Upvotes: 2
Views: 81
Reputation: 3138
Please change your setting and try again. Task Path = "/scheduled/cleanData.sjs", Task Root="/". I am assuming cleanData.sjs and cleanDataLib.xqy is on the same place '/src/scheduled'
Upvotes: 2