diff Implab/Components/PollingComponent.cs @ 260:547a2fc0d93e v3 v3.0.6

minor fixes
author cin
date Fri, 13 Apr 2018 19:14:59 +0300
parents 7d52dc684bbd
children f1696cdc3d7a
line wrap: on
line diff
--- a/Implab/Components/PollingComponent.cs	Fri Apr 13 03:57:39 2018 +0300
+++ b/Implab/Components/PollingComponent.cs	Fri Apr 13 19:14:59 2018 +0300
@@ -50,7 +50,7 @@
             try {
                 // await for pending poll
                 await m_poll;
-            } catch (OperationCanceledException e) {
+            } catch (OperationCanceledException) {
                 // OK
             }
         }
@@ -71,12 +71,16 @@
             try {
                 m_pending.Start();
                 await m_poll;
+                ScheduleNextPoll(Interval);
             } catch (Exception e) {
                 UnhandledException.DispatchEvent(this, new UnhandledExceptionEventArgs(e, false));
+
                 if (FailOnError)
                     Fail(e);
+                else
+                    ScheduleNextPoll(Interval);
             }
-            ScheduleNextPoll(Interval);
+            
         }
 
         protected override void Dispose(bool disposing) {