From 0b59571e2769efd81d2d1c8d557f29398cf8619c Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Sat, 10 Apr 2021 18:37:42 +0300 Subject: [PATCH] ReadData should only sleep if it encounters an Exception. --- PMS5003/PMS5003.cs | 2 +- PMS5003/PMS5003.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PMS5003/PMS5003.cs b/PMS5003/PMS5003.cs index 07601e7..d1dc7cd 100644 --- a/PMS5003/PMS5003.cs +++ b/PMS5003/PMS5003.cs @@ -92,11 +92,11 @@ namespace PMS5003 catch (Exception e) { Logger?.LogWarning(e.ToString()); + Thread.Sleep(1000); } finally { currentTry += 1; - Thread.Sleep(1000); } } diff --git a/PMS5003/PMS5003.csproj b/PMS5003/PMS5003.csproj index 1ee79b7..934bb44 100644 --- a/PMS5003/PMS5003.csproj +++ b/PMS5003/PMS5003.csproj @@ -4,7 +4,7 @@ Exe netcoreapp3.1 PMS5003 - 1.0.2 + 1.0.3 Denis Nutiu NucuLabs.dev C# Library for interfacing with the PMS5003 Particulate Matter Sensor.