...
This commit is contained in:
parent
aa9a0a7b24
commit
f0cbf1c4fd
@ -53,11 +53,16 @@ class LocationUpdateService : Service(), LocationListener {
|
|||||||
WorkersDb.getRealm()?.apply {
|
WorkersDb.getRealm()?.apply {
|
||||||
LocationLog().let { loc ->
|
LocationLog().let { loc ->
|
||||||
loc.fillData(it)
|
loc.fillData(it)
|
||||||
var list = query<LocationLog>().sort("time", Sort.DESCENDING).find()
|
|
||||||
|
var list = query<LocationLog>().query("userId == $0", PrefString.telegramMyId.get("")).sort("time", Sort.DESCENDING).find()
|
||||||
|
val post = (list.size == 0 || (list.size > 0 && list.first().time < (System.currentTimeMillis() - (1000L * 60L * 5L))) && inRangeLocation(lat,long,50) == false)
|
||||||
writeBlocking {
|
writeBlocking {
|
||||||
|
if (post) {
|
||||||
|
loc.userId = PrefString.telegramMyId.get("")
|
||||||
copyToRealm(loc)
|
copyToRealm(loc)
|
||||||
}
|
}
|
||||||
(list.size == 0 || (list.size > 0 && list.first().time < (System.currentTimeMillis() - (1000L * 60L * 5L))) && inRangeLocation(lat,long,50) == false).letTrue {
|
}
|
||||||
|
post.letTrue {
|
||||||
Executors.newSingleThreadScheduledExecutor().schedule({
|
Executors.newSingleThreadScheduledExecutor().schedule({
|
||||||
try {
|
try {
|
||||||
//////-1002450229641
|
//////-1002450229641
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user