No, after modifying the desired running time and adding your code, simply run this script without any further configuration.
brainCloudAdmin
brainCloud personnel
Posts
-
-
Here is an example of scheduling a weekly cloud code execution,
"use strict"; function main() { var response = {} bridge.logDebugJson("Script Inputs", data) const scriptName = data.scriptName const interval = data.args.interval const searchSpan = interval < 60 ? 60 : 60 * 24 // schedule checking and re-schedule itself for the next week at 23:59 on the same day var scriptProxy = bridge.getScriptServiceProxy() var dateTimeSpanMinsFromNowInMillis = new Date().getTime() + (searchSpan * 60 * 1000) var result = scriptProxy.getScheduledCloudScripts(dateTimeSpanMinsFromNowInMillis) var nowTime = new Date().getTime() if ((result.status == 200) && (result.data !== null)) { for (var i = 0; i < result.data.scheduledJobs.length; i++) { if (result.data.scheduledJobs[i].scriptName === scriptName && result.data.scheduledJobs[i].scheduledStartTime > nowTime) { scriptProxy.cancelScheduledScript(result.data.scheduledJobs[i].jobId) } } } const targetHour = 23 const targetMinute = 59 const minutesDifference = getMinutesDifference(targetHour, targetMinute) let minutesFromNow = minutesDifference + interval bridge.logInfo(`minutesFromNow between the script calling time and the time of 23:59 on a same day${minutesFromNow}`) response.scheduleJob = scriptProxy.scheduleRunScriptMinutes(scriptName, data, minutesFromNow) // the code for your script return response } function getMinutesDifference(targetHour, targetMinute) { const now = new Date() const targetTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), targetHour, targetMinute) const differenceInMilliseconds = targetTime - now bridge.logInfo(`differenceInMilliseconds between the script calling time and the target time: ${differenceInMilliseconds}`) const differenceInMinutes = Math.floor(differenceInMilliseconds / (1000 * 60)) return differenceInMinutes } main()
The parameters for this script will be like below, the
interval
will be10080
minutes (a week),{ "scriptName": "thisScriptNameItself", "args": { "interval": 10080 } }
-
Hi @antony - I'll send that one off to the devs and see how that would affect the implementation.
We'd likely make it a separate call - as that's a heavier operation that just returning your friends in relative order. That said - if you have to do it manually yourself that's a LOT heavier on the servers -- so I agree that this new call would be beneficial.
Stay tuned!
-
Hi folks,
FYI, here's one minor update regarding the Retention Analytics screen:
We have changed it to show Classic retention by default.
The reason for the change is that Rolling Retention naturally trends downward over the 30-day period of the report. That's simply due to mathematics. Rolling retention for a particular day measures whether the user returns that day - or any day thereafter. Thus - the days at the end of the calendar period have fewer days after them - and so the stat will naturally be lower.
We don't want folks to mistakenly think their retention is trending down - so we're now defaulting to Classic Retention which is more deterministic over the 30 day period. For those who wish to view the Rolling Retention - it's just a mouse click away!
Cheers!
Paul.
-
Right now the only valid value is "retention" - but obviously we've built that API with an eye to the future!
-
Well - the "owned custom entities" approach could come into play again if you want to view the matches across the system. Although owned custom entities are owned by players (and get deleted if a player account is deleted) - they are still queryable across the system... via API or the Portal (see App > Global > Global Data > Custom Entities ).
I hope that helps!
-
Oh - and I should note that you can retrieve the latest retention report - as well as the retention report for a specific start date...
https://docs.braincloudservers.com/api/capi/report/sysgetlatestreport
What we don't have right now is an API to list the reports that are generated and waiting for retrieval. We are working on that for a future patch.
Also note that we currently keep daily reports for 10 days - and weekly reports for 37 days.
-
Thanks for the feedback Christophe! We'll take a look into those requests.
-
Hi,
Users with LIVE apps on brainCloud's Public BaaS (i.e., https://portalx.braincloudservers.com) should now have access to our Retention Analytics. (You can find the numbers on the App > Reports > Analytics > Retention screen.).
So - any questions on these numbers? What they mean? How they are calculated? We are happy to clarify any questions you may have.
We are also interested in your overall feedback regarding the feature.
We've already had the question of whether we could calculate the numbers on a per app-version basic... (i.e. according to the
gameVersion
passed into the Authenticate call). We're going to look into that. That said - the whole reason we did Retention Analytics was so that we could integrate it with a new LiveOps Events feature we're working on -- so we'll probably tackle those scenarios at the same time.Anyway - your feedback is invaluable. So look up your numbers and hit us up with questions and/or feedback!
Paul.
-
Hi @tlim and @devsleeper ,
Player stats are definitely useful for keeping all-time stats.
If you want to limit stats to recent matches - you might consider using "Owned Custom Entities" for each match result. You can set a TTL for the objects so they don't stick around too long - maybe 90 days?
And then just retrieve the last 20 match results (if they exist) to sum up the totals and produce the stats.
I hope that helps!
Paul.
Recurring scheduled tasks?
Recurring scheduled tasks?
Return global rank for entries in social leaderboard
Any questions regarding the new Retention Analytics?
Any questions regarding the new Retention Analytics?
Match history
Any questions regarding the new Retention Analytics?
Any questions regarding the new Retention Analytics?
Any questions regarding the new Retention Analytics?
Match history