celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1632924 - /celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c
Date Sun, 19 Oct 2014 14:45:08 GMT
Author: bpetri
Date: Sun Oct 19 14:45:07 2014
New Revision: 1632924

URL: http://svn.apache.org/r1632924
Log:
CELIX-152: code refactoring fix

Modified:
    celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c

Modified: celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c?rev=1632924&r1=1632923&r2=1632924&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c (original)
+++ celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c Sun Oct 19 14:45:07
2014
@@ -203,7 +203,7 @@ static celix_status_t etcdWatcher_addOwn
  */
 static void* etcdWatcher_run(void* data) {
 	etcd_watcher_pt watcher = (etcd_watcher_pt) data;
-
+	time_t timeBeforeWatch = time(NULL);
 	static char rootPath[MAX_ROOTNODE_LENGTH];
 	int highestModified = 0;
 
@@ -218,7 +218,6 @@ static void* etcdWatcher_run(void* data)
 		char preValue[MAX_VALUE_LENGTH];
 		char action[MAX_ACTION_LENGTH];
 
-		time_t timeBeforeWatch = time(NULL);
 
 		if (etcd_watch(rootPath, 0, &action[0], &preValue[0], &value[0]) == true) {
 
@@ -236,6 +235,7 @@ static void* etcdWatcher_run(void* data)
 		// update own framework uuid
 		if (time(NULL) - timeBeforeWatch > (DEFAULT_ETCD_TTL/2)) {
 			etcdWatcher_addOwnFramework(watcher);
+			timeBeforeWatch = time(NULL);
 		}
 	}
 



Mime
View raw message