MCPcopy
hub / github.com/crowdsecurity/crowdsec / newSyncCmd

Method newSyncCmd

cmd/crowdsec-cli/clipapi/papi.go:156–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154}
155
156func (cli *cliPapi) newSyncCmd() *cobra.Command {
157 cmd := &cobra.Command{
158 Use: "sync",
159 Short: "Sync with the Polling API, pulling all non-expired orders for the instance",
160 Args: args.NoArgs,
161 DisableAutoGenTag: true,
162 RunE: func(cmd *cobra.Command, _ []string) error {
163 cfg := cli.cfg()
164 ctx := cmd.Context()
165
166 db, err := require.DBClient(ctx, cfg.DbConfig)
167 if err != nil {
168 return err
169 }
170
171 return cli.sync(ctx, db)
172 },
173 }
174
175 return cmd
176}

Callers 1

NewCommandMethod · 0.95

Calls 3

syncMethod · 0.95
DBClientFunction · 0.92
cfgMethod · 0.80

Tested by

no test coverage detected