Skip to content
Snippets Groups Projects
Commit 3ef67ca3 authored by Server (Shared Users)'s avatar Server (Shared Users)
Browse files

middle output

parent 310ae081
No related branches found
No related tags found
No related merge requests found
...@@ -38,18 +38,17 @@ class CoAPServer(CoAP): ...@@ -38,18 +38,17 @@ class CoAPServer(CoAP):
for c in cursor: for c in cursor:
positionCalculationThread = threading.Thread(target = self.positionCalculation, args=([c['uuid']])) positionCalculationThread = threading.Thread(target = self.positionCalculation, args=([c['uuid']]))
positionCalculationThread.start() positionCalculationThread.start()
time.sleep(3) time.sleep(3.1)
currentTime = time.time()
trackingCursor = self.trackingCollection.remove({'updateTime': {'lte' : currentTime - 3}})
except KeyboardInterrupt: except KeyboardInterrupt:
print("existing updateUserLocation") print("existing updateUserLocation")
def positionCalculation(self, useruuid): def positionCalculation(self, useruuid):
currentTime = time.time() currentTime = time.time()
"""
trackingCursor = self.trackingCollection.find({'$and':[{'useruuid':{'$eq' : useruuid}}, trackingCursor = self.trackingCollection.find({'$and':[{'useruuid':{'$eq' : useruuid}},
{'updateTime':{'$gt' : currentTime - 3}}]}) {'updateTime':{'$gt' : currentTime - 3}}]})
실제 코드, 밑에는 테스트용 코드 #trackingCursor = self.trackingCollection.find({'$and':[{'useruuid':{'$eq' : useruuid}}]})
"""
trackingCursor = self.trackingCollection.find({'$and':[{'useruuid':{'$eq' : useruuid}}]})
userLocationData =[] userLocationData =[]
flag = 0 flag = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment