(ctx devspacecontext.Context, options *Options, parent *tomb.Tomb)
| 58 | } |
| 59 | |
| 60 | func (c *controller) Start(ctx devspacecontext.Context, options *Options, parent *tomb.Tomb) error { |
| 61 | pluginErr := hook.ExecuteHooks(ctx, map[string]interface{}{ |
| 62 | "sync_config": options.SyncConfig, |
| 63 | }, hook.EventsForSingle("start:sync", options.Name).With("sync.start")...) |
| 64 | if pluginErr != nil { |
| 65 | return pluginErr |
| 66 | } |
| 67 | |
| 68 | err := c.startWithWait(ctx, options, parent) |
| 69 | if err != nil { |
| 70 | pluginErr := hook.ExecuteHooks(ctx, map[string]interface{}{ |
| 71 | "sync_config": options.SyncConfig, |
| 72 | "ERROR": err, |
| 73 | }, hook.EventsForSingle("error:sync", options.Name).With("sync.error")...) |
| 74 | if pluginErr != nil { |
| 75 | return pluginErr |
| 76 | } |
| 77 | |
| 78 | return err |
| 79 | } |
| 80 | |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | func (c *controller) startWithWait(ctx devspacecontext.Context, options *Options, parent *tomb.Tomb) error { |
| 85 | if ctx.IsDone() { |
nothing calls this directly
no test coverage detected