dmtzs / SmartTerrariumR

A project that is used for creating a smart terrarium for your reptile pets. This project is for managing all parameters that the reptile needs in order to have a great life. This is the raspberry version.
https://dmtzs.github.io/SmartTerrariumR/
Other
2 stars 0 forks source link

Bug at closing the flask server at developer mode #8

Closed dmtzs closed 2 years ago

dmtzs commented 2 years ago

At the moment we try to close the flask server when we run the electron app with the command npm start at the moment we close the electron app there is an error when we close the flask server. The error that appears is the next one and we should close it.

Traceback (most recent call last): File "C:\Users\Diego\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 2070, in wsgi_app response = self.full_dispatch_request() File "C:\Users\Diego\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 1515, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\Diego\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 1513, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\Diego\AppData\Local\Programs\Python\Python38-32\lib\site-packages\flask\app.py", line 1499, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "main.py", line 263, in closeAll conn.closeConnection() File "C:\Users\Diego\Documents\ProyectoRaspArduino\resources\Flask\TerrariumLib\ArduinoConnection.py", line 89, in closeConnection self.connection.close() AttributeError: 'NoneType' object has no attribute 'close'

dmtzs commented 2 years ago

We need to change the code about how we need to close the flask server. After that the issue will be closed. But its good to clarify that the problem and its respective solution its already identified.

dmtzs commented 2 years ago

I already change the way we close the flask server, this issue will still open until the next tests are executed.

dmtzs commented 2 years ago

Tests were executed with sucess, now this bug is fixed. Closing this issue.