Add DEBUG environment variable

This commit is contained in:
Tanner Collin 2020-02-23 01:03:41 +00:00
parent 92d9405445
commit 035b1c4bad

View File

@ -6,11 +6,14 @@ logging.basicConfig(
from multiprocessing import Process, Queue from multiprocessing import Process, Queue
from queue import Empty from queue import Empty
import RPi.GPIO as GPIO import RPi.GPIO as GPIO
import os
import json import json
import requests import requests
import serial import serial
import time import time
DEBUG = os.environ.get('DEBUG', False)
RELAY_PIN = 17 RELAY_PIN = 17
RFID_EN_PIN = 27 RFID_EN_PIN = 27
CARDS_FILE = 'card_data.json' CARDS_FILE = 'card_data.json'
@ -141,4 +144,4 @@ if __name__ == '__main__':
Process(target=reader_thread, args=(card_data,)).start() Process(target=reader_thread, args=(card_data,)).start()
Process(target=update_thread, args=(card_data,)).start() Process(target=update_thread, args=(card_data,)).start()
Process(target=watchdog_thread).start() if not DEBUG: Process(target=watchdog_thread).start()