Ejemplo n.º 1
0
        public override Task StartAsync(CancellationToken cancellationToken)
        {
            watcher = new FileSystemWatcher(path);

            watcher.Changed += OnChanged;
            watcher.Created += OnChanged;
            watcher.Deleted += OnDeleted;
            watcher.Renamed += OnRenamed;
            _fileLogger.ClearLog();
            _fileLogger.Log($"{DateTimeOffset.UtcNow} | Service started.");

            return(base.StartAsync(cancellationToken));
        }