Currently, I have this job set up to clear out unnecessary records. The code provided has been simplified for debugging purposes. However, almost 80% of the time when running it, it fails to find anything due to Error code 1 "internal error":
Parse.Cloud.job('cleanStories', function(request, status) {
Parse.Cloud.useMasterKey();
var counter = 0;
var query = new Parse.Query('Story');
query.doesNotExist("username");
query.limit(1000);
query.find({
success: function(results) {
counter += results.length;
status.success(counter + " stories found.");
},
error: function(error) {
status.error(counter + " stories found. Error: " + error.code + " " + error.message);
}
});
});
Currently, I have around 568k records. Initially, there were close to 800k records before I began running this job to clear them out. While it used to work fine, now it's consistently showing errors. What could be the issue here?
EDIT:
I've reduced the limit to 50 and noticed a higher success rate in execution. Even with the default limit of 100, it still fails frequently. Is there a way I can increase the limit back to 1000 to speed up processing through the remaining records?