# HG changeset patch # User Sascha L. Teichmann # Date 1583332566 -3600 # Node ID 21d2acc080c91f8846f97d76132330df75b2ed24 # Parent ee12730acd73e357e5e21d987e5a5a06d55362eb Add the ability to be staged to the WFS feature downloader. This will be needed for FD downloads. diff -r ee12730acd73 -r 21d2acc080c9 pkg/imports/wfsjob.go --- a/pkg/imports/wfsjob.go Tue Mar 03 18:13:57 2020 +0100 +++ b/pkg/imports/wfsjob.go Wed Mar 04 15:36:06 2020 +0100 @@ -48,6 +48,8 @@ depends [2][]string newConsumer func(context.Context, *sql.Conn, Feedback) (WFSFeatureConsumer, error) + + stageDone func(context.Context, *sql.Tx, int64) error } WFSFeatureJob struct { @@ -64,13 +66,15 @@ return wfjc.depends } -func (*WFSFeatureJobCreator) AutoAccept() bool { - return true +func (wfjc *WFSFeatureJobCreator) AutoAccept() bool { + return wfjc.stageDone == nil } -// StageDone is a NOP for WFS imports. -func (*WFSFeatureJobCreator) StageDone(context.Context, *sql.Tx, int64) error { - return nil +func (wfjc *WFSFeatureJobCreator) StageDone(ctx context.Context, tx *sql.Tx, id int64) error { + if wfjc.stageDone == nil { + return nil + } + return wfjc.stageDone(ctx, tx, id) } func (wfjc *WFSFeatureJobCreator) Create() Job {