@@ -73,7 +73,7 @@ func (d *dis) DispatchEvent(e *et.Event) error {
7373}
7474
7575func (d * dis ) maintainPipelines () {
76- ctick := time .NewTimer (5 * time .Second )
76+ ctick := time .NewTimer (time .Second )
7777 defer ctick .Stop ()
7878 mtick := time .NewTimer (10 * time .Second )
7979 defer mtick .Stop ()
8787 mtick .Reset (10 * time .Second )
8888 case <- ctick .C :
8989 d .fillPipelineQueues ()
90- ctick .Reset (5 * time .Second )
90+ ctick .Reset (time .Second )
9191 case e := <- d .dchan :
9292 if err := d .safeDispatch (e ); err != nil {
9393 d .logger .Error (fmt .Sprintf ("Failed to dispatch event: %s" , err .Error ()))
@@ -172,8 +172,8 @@ func (d *dis) completedCallback(data interface{}) {
172172}
173173
174174func (d * dis ) safeDispatch (e * et.Event ) error {
175- ap , err := d . reg . GetPipeline ( e . Entity . Asset . AssetType ())
176- if err ! = nil {
175+ // there is not need to dispatch the event if there's no associated asset pipeline
176+ if ap , err := d . reg . GetPipeline ( e . Entity . Asset . AssetType ()); err != nil || ap = = nil {
177177 return err
178178 }
179179
@@ -182,7 +182,7 @@ func (d *dis) safeDispatch(e *et.Event) error {
182182 return nil
183183 }
184184
185- err = e .Session .Queue ().Append (e .Entity )
185+ err : = e .Session .Queue ().Append (e .Entity )
186186 if err != nil {
187187 return err
188188 }
@@ -194,7 +194,7 @@ func (d *dis) safeDispatch(e *et.Event) error {
194194 stats .Unlock ()
195195 }
196196
197- if qlen := ap . Queue . Len (); e .Meta != nil || qlen < MinPipelineQueueSize {
197+ if e .Meta != nil {
198198 if err := d .appendToPipeline (e ); err != nil {
199199 d .logger .Error (fmt .Sprintf ("Failed to append to a data pipeline: %s" , err .Error ()))
200200 return err
0 commit comments