Basicly what im trying to do is with scheduled task (every hour), run a function in cloudscript that checks every player that has died in a segment (that only saves players with the "deaths" statistic) and adds the number of deaths together and updates the title data "GlobalDeaths".
Im running this code to see if im able to get the players from that segment.
handlers.UpdateGlobalDeaths = function(args) { var deathCount = 0; var resultPlayers = server.GetPlayersInSegment ({ SegmentId: "1664F484840041B", SecondsToLive: 300, MaxBatchSize: 10000 }); var playersInSegmentResult = server.GetPlayersInSegment(resultPlayers); log.debug("Total players = " + playersInSegmentResult.playerProfile.length); }
Everytime i run this through the scheduled task i get this error, any idea what the cause of this is?
There are currently 60 people with "Deaths" of the 68.
"Result": { "FunctionName": "UpdateGlobalDeaths", "Revision": 29, "FunctionResult": null, "FunctionResultTooLarge": null, "Logs": [ { "Level": "Error", "Message": "PlayFab API request failure", "Data": { "api": "/Server/GetPlayersInSegment", "request": { "SegmentId": "1664F484840041B", "SecondsToLive": 300, "MaxBatchSize": 10000 }, "error": "Timeout" } } ], "LogsTooLarge": null, "ExecutionTimeSeconds": 4.0044373, "ProcessorTimeSeconds": 0.002978, "MemoryConsumedBytes": 9024, "APIRequestsIssued": 1, "HttpRequestsIssued": 0, "Error": { "Error": "InternalServerError", "Message": "InternalServerError", "StackTrace": "Error\n at Object.server_request (Script:162:24)\n at Object.server.GetPlayersInSegment (Script:539:76)\n at handlers.UpdateGlobalDeaths (B1C57-main.js:86:32)\n at Object.invokeFunction (Script:117:33)" } }