We've created an app but at this point there is an issue with the amount of calls the phone is making. It's an app for a delivery man with small packages.
To track the mobile phone (and packages) we create every 30 seconds an GPS-file and send it to our server in the background. After succesfull sending the file gets deleted.
During the route the delivery man does a lot of stuff on the phone, resulting in several small and sometimes larger files.
Sometimes the server isn't reachable (for example when server is down). Then all files get buffered on the device. If there is a new file saved then the device tries to send it files.
Is there a way to control the amount of files that are being send? For example if the server is down 2 hours and there could be ~240 files waiting to send. If this is the case and there are 200 devices waiting we talk about 48.000 calls in a matter of seconds. This overloads our server. Is there a way to regulate the data? Some kind of manager?
Below I've included our current upload of the gps-files.
To track the mobile phone (and packages) we create every 30 seconds an GPS-file and send it to our server in the background. After succesfull sending the file gets deleted.
During the route the delivery man does a lot of stuff on the phone, resulting in several small and sometimes larger files.
Sometimes the server isn't reachable (for example when server is down). Then all files get buffered on the device. If there is a new file saved then the device tries to send it files.
Is there a way to control the amount of files that are being send? For example if the server is down 2 hours and there could be ~240 files waiting to send. If this is the case and there are 200 devices waiting we talk about 48.000 calls in a matter of seconds. This overloads our server. Is there a way to regulate the data? Some kind of manager?
Below I've included our current upload of the gps-files.
B4X:
For i = 0 To lFiles.Size-1
sNewFile = lFiles.Get(i)
Try
If ((sNewFile.Contains("JSON"))) Then
sParameter = Globaal.ReturnJsonFromFile(Globaal.Map_GPS,sNewFile)
Soap.Initialize("PutGPS",Me)
Soap.PostString(Globaal.MainRESTUrl&"PutGPS",sParameter.Replace("[","").Replace("]",""))
Soap.GetRequest.SetHeader("lmmobile",Globaal.PDAID.Trim)
Soap.GetRequest.SetHeader("wachtwoord",Globaal.wachtwoord.Trim)
Soap.GetRequest.SetHeader("Content-Type", "application/json")
wait for (Soap) jobdone(Soap As HttpJob)
If Soap.Success Then
Soap.Release
Globaal.DeleteAFile(Globaal.Map_GPS,sNewFile)
Else
If Soap.ErrorMessage.Trim<>"" Then
Soap.Release
Exit
End If
Soap.Release
End If
End If
Catch
If Soap.IsInitialized Then Soap.Release
Globaal.DeleteAFile(Globaal.Map_GPS,sNewFile)
End Try
Next