This is an automated email from the ASF dual-hosted git repository.
eamonford pushed a commit to branch async-history
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git
The following commit(s) were added to refs/heads/async-history by this push:
new c46d79a revert
c46d79a is described below
commit c46d79ae5343af306a32659239fa6e3ceb0d2149
Author: Eamon Ford <[email protected]>
AuthorDate: Mon Aug 10 19:21:09 2020 -0700
revert
---
.../collection_manager/services/CollectionWatcher.py | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git
a/collection_manager/collection_manager/services/CollectionWatcher.py
b/collection_manager/collection_manager/services/CollectionWatcher.py
index 49acceb..8911806 100644
--- a/collection_manager/collection_manager/services/CollectionWatcher.py
+++ b/collection_manager/collection_manager/services/CollectionWatcher.py
@@ -1,5 +1,4 @@
import asyncio
-import time
import logging
import os
from collections import defaultdict
@@ -7,6 +6,7 @@ from typing import Dict, Callable, Set, Optional, Awaitable
import yaml
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
+from yaml.scanner import ScannerError
from collection_manager.entities import Collection
from collection_manager.entities.exceptions import RelativePathError,
CollectionConfigParsingError, \
@@ -102,13 +102,9 @@ class CollectionWatcher:
async def _reload_and_reschedule(self):
try:
updated_collections = self._get_updated_collections()
+ for collection in updated_collections:
+ await self._collection_updated_callback(collection)
if len(updated_collections) > 0:
- logger.info(f"Scanning files for {len(updated_collections)}
collections...")
- start = time.perf_counter()
- for collection in updated_collections:
- await self._collection_updated_callback(collection)
- logger.info(f"Finished scanning files in {time.perf_counter()
- start} seconds.")
-
self._unschedule_watches()
self._schedule_watches()
except CollectionConfigParsingError as e:
@@ -165,11 +161,6 @@ class _GranuleEventHandler(FileSystemEventHandler):
self._callback = callback
self._collections_for_dir = collections_for_dir
- def on_any_event(self, event):
- super().on_created(event)
-
- logger.info(f"Collection Watcher received event: {event}")
-
def on_created(self, event):
super().on_created(event)
for collection in self._collections_for_dir: