iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [6/9] incubator-iota git commit: processInitialFiles should not be called inside the run() loop
Date Thu, 14 Jul 2016 19:54:35 GMT
processInitialFiles should not be called inside the run() loop


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/cca9d8b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/cca9d8b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/cca9d8b3

Branch: refs/heads/master
Commit: cca9d8b35c09dcc9c3085fb4ba1403123bacdf1b
Parents: 47dac9d
Author: Barbara Gomes <barbaramaltagomes@gmail.com>
Authored: Thu Jul 14 09:59:30 2016 -0700
Committer: Barbara Gomes <barbaramaltagomes@gmail.com>
Committed: Thu Jul 14 09:59:30 2016 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/iota/fey/WatchServiceReceiver.scala    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/cca9d8b3/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala b/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
index e42bcbb..58d25b0 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
@@ -29,6 +29,8 @@ import scala.io.Source
 
 class WatchServiceReceiver(receiverActor: ActorRef) extends JsonReceiver{
 
+  processInitialFiles()
+
   private val watchService = FileSystems.getDefault.newWatchService()
 
   def watch(path: Path) : Unit = path.register(watchService, ENTRY_CREATE, ENTRY_MODIFY)
@@ -45,7 +47,6 @@ class WatchServiceReceiver(receiverActor: ActorRef) extends JsonReceiver{
   }
 
   override def execute(): Unit = {
-    processInitialFiles()
 
     val key = watchService.take()
     val eventsIterator = key.pollEvents().iterator()
@@ -55,6 +56,7 @@ class WatchServiceReceiver(receiverActor: ActorRef) extends JsonReceiver{
       val relativePath = event.context().asInstanceOf[Path]
       val path = key.watchable().asInstanceOf[Path].resolve(relativePath)
 
+      log.debug(s"${event.kind()} --- $path")
       event.kind() match {
         case (ENTRY_CREATE | ENTRY_MODIFY) if path.toString.endsWith(CONFIG.JSON_EXTENSION)
=>
           processJson(path.toString, path.toFile)


Mime
View raw message