В Parse Documentation on background jobs есть выражение, беспокоящее меня.Счетчик в фоновом режиме
if (counter % 100 === 0) {
// Set the job's progress status
status.message(counter + " users processed.");
}
counter += 1;
Может ли кто-нибудь объяснить эту часть? Особенно первая строка. Благодаря! Также, как лучше всего назвать работу в Xamarin?
Parse.Cloud.job("userMigration", function(request, status) {
// Set up to modify user data
Parse.Cloud.useMasterKey();
var counter = 0;
// Query for all users
var query = new Parse.Query(Parse.User);
query.each(function(user) {
// Update to plan value passed in
user.set("plan", request.params.plan);
if (counter % 100 === 0) {
// Set the job's progress status
status.message(counter + " users processed.");
}
counter += 1;
return user.save();
}).then(function() {
// Set the job's success status
status.success("Migration completed successfully.");
}, function(error) {
// Set the job's error status
status.error("Uh oh, something went wrong.");
});
});
http://ru.wikipedia.org/wiki/Modulo_operation – Rob