Browse Source

Less logging

pull/72/head
Dashie der otter 10 months ago
parent
commit
1fe062684f
Signed by: dashie <rhaamo@leloop.org> GPG Key ID: C2D57B325840B755
4 changed files with 7 additions and 8 deletions
  1. +1
    -1
      airwaves_adsb_client.py
  2. +5
    -5
      airwaves_ais_client.py
  3. +1
    -1
      backend/lib/mix/tasks/pyairwaves/update_aircrafts.ex
  4. +0
    -1
      libPyAirwaves/structs.py

+ 1
- 1
airwaves_adsb_client.py View File

@@ -99,7 +99,7 @@ if __name__ == "__main__":
adsb_message.srcPosMode = config.ADSB_SOURCE["posMode"]
adsb_message.dataOrigin = "dump1090"

print(adsb_message.to_dict())
# print(adsb_message.to_dict())
redis.publish("room:vehicles", json.dumps(adsb_message.to_dict()))
# It's valid, reset stream message
data_str = ""


+ 5
- 5
airwaves_ais_client.py View File

@@ -19,10 +19,10 @@ pubsub.subscribe("room:vehicles")

def broadcast(msg: pyais.messages.NMEAMessage):
is_fragmented = msg.count > 1
if is_fragmented:
print("Fragmented packet:", msg)
else:
print("Single packet:", msg)
# if is_fragmented:
# print("Fragmented packet:", msg)
# else:
# print("Single packet:", msg)

ais_message = AisType()
ais_message.entryPoint = "airwaves_ais_client"
@@ -45,7 +45,7 @@ def broadcast(msg: pyais.messages.NMEAMessage):

# Valid message and emit if lat/lon are present
# if ais_message.lat and ais_message.lon:
print(ais_message.to_dict())
# print(ais_message.to_dict())
redis.publish("room:vehicles", json.dumps(ais_message.to_dict()))




+ 1
- 1
backend/lib/mix/tasks/pyairwaves/update_aircrafts.ex View File

@@ -95,7 +95,7 @@ defmodule Mix.Tasks.Pyairwaves.UpdateAircrafts do
# Enum.each(aircrafts, fn {})
|> Enum.chunk_every(1000)
|> Enum.map(fn chunk ->
Pyairwaves.Repo.insert_all(Pyairwaves.Aircraft, chunk, on_conflict: :nothing)
Pyairwaves.Repo.insert_all(Pyairwaves.Aircraft, chunk, on_conflict: :nothing, log: false)
end)

Logger.info("Update finished.")


+ 0
- 1
libPyAirwaves/structs.py View File

@@ -350,7 +350,6 @@ class AisType(DefaultType):
# 'shipname': 'ETRETAT', 'shiptype': <ShipType.Passenger_NoAdditionalInformation: 69>, 'to_bow': 24,
# 'to_stern': 163, 'to_port': 8, 'to_starboard': 18, 'epfd': <EpfdType.GPS: 1>, 'month': 2, 'day': 13,
# 'hour': 17, 'minute': 30, 'draught': 6.0, 'destination': 'SANTANDER', 'dte': False}
print("chomp chomp AIS VDM")

self.dts = str(datetime.datetime.utcnow())



Loading…
Cancel
Save