...
This commit is contained in:
parent
aa9a0a7b24
commit
f0cbf1c4fd
@ -53,11 +53,16 @@ class LocationUpdateService : Service(), LocationListener {
|
||||
WorkersDb.getRealm()?.apply {
|
||||
LocationLog().let { loc ->
|
||||
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 {
|
||||
copyToRealm(loc)
|
||||
if (post) {
|
||||
loc.userId = PrefString.telegramMyId.get("")
|
||||
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({
|
||||
try {
|
||||
//////-1002450229641
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user