(rep repo.RepositoryWriter)
| 227 | } |
| 228 | |
| 229 | func (c *commandSnapshotCreate) setupUploader(rep repo.RepositoryWriter) *upload.Uploader { |
| 230 | u := upload.NewUploader(rep) |
| 231 | u.MaxUploadBytes = c.snapshotCreateCheckpointUploadLimitMB << 20 //nolint:mnd |
| 232 | |
| 233 | if c.snapshotCreateForceEnableActions { |
| 234 | u.EnableActions = true |
| 235 | } |
| 236 | |
| 237 | if c.snapshotCreateForceDisableActions { |
| 238 | u.EnableActions = false |
| 239 | } |
| 240 | |
| 241 | if l := c.logDirDetail; l != -1 { |
| 242 | ld := policy.LogDetail(l) |
| 243 | |
| 244 | u.OverrideDirLogDetail = &ld |
| 245 | } |
| 246 | |
| 247 | if l := c.logEntryDetail; l != -1 { |
| 248 | ld := policy.LogDetail(l) |
| 249 | |
| 250 | u.OverrideEntryLogDetail = &ld |
| 251 | } |
| 252 | |
| 253 | if interval := c.snapshotCreateCheckpointInterval; interval != 0 { |
| 254 | u.CheckpointInterval = interval |
| 255 | } |
| 256 | |
| 257 | c.svc.onTerminate(u.Cancel) |
| 258 | |
| 259 | u.ForceHashPercentage = c.snapshotCreateForceHash |
| 260 | u.ParallelUploads = c.snapshotCreateParallelUploads |
| 261 | |
| 262 | u.FailFast = c.snapshotCreateFailFast |
| 263 | u.Progress = c.svc.getProgress() |
| 264 | |
| 265 | return u |
| 266 | } |
| 267 | |
| 268 | func parseTimestamp(timestamp string) (time.Time, error) { |
| 269 | if timestamp == "" { |
no test coverage detected