Skip to content

Commit

Permalink
Integrate updated at file_source crate into the file source
Browse files Browse the repository at this point in the history
Signed-off-by: MOZGIII <[email protected]>
  • Loading branch information
MOZGIII committed May 5, 2020
1 parent 7b958c0 commit 9c3866a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/sources/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use crate::{
trace::{current_span, Instrument},
};
use bytes::Bytes;
use file_source::{FileServer, Fingerprinter, GlobPathProvider};
use file_source::{
paths_provider::glob::{Glob, MatchOptions},
FileServer, Fingerprinter,
};
use futures::{
compat::{Compat01As03Sink, Future01CompatExt},
future::{FutureExt, TryFutureExt},
Expand Down Expand Up @@ -232,10 +235,11 @@ pub fn file_source(
.map(|secs| SystemTime::now() - Duration::from_secs(secs));
let glob_minimum_cooldown = Duration::from_millis(config.glob_minimum_cooldown);

let path_provider = GlobPathProvider::new(&config.include, &config.exclude);
let paths_provider = Glob::new(&config.include, &config.exclude, MatchOptions::default())
.expect("invalid glob patterns");

let file_server = FileServer {
path_provider,
paths_provider,
max_read_bytes: config.max_read_bytes,
start_at_beginning: config.start_at_beginning,
ignore_before,
Expand Down

0 comments on commit 9c3866a

Please sign in to comment.