(ctx context.Context, in rc.Params)
| 527 | } |
| 528 | |
| 529 | func rcQueueSetExpiry(ctx context.Context, in rc.Params) (out rc.Params, err error) { |
| 530 | vfs, err := getVFS(in) |
| 531 | if err != nil { |
| 532 | return nil, err |
| 533 | } |
| 534 | if vfs.cache == nil { |
| 535 | return nil, rc.NewErrParamInvalid(errors.New("can't call this unless using the VFS cache")) |
| 536 | } |
| 537 | |
| 538 | // Read input values |
| 539 | id, err := in.GetInt64("id") |
| 540 | if err != nil { |
| 541 | return nil, err |
| 542 | } |
| 543 | expiry, err := in.GetFloat64("expiry") |
| 544 | if err != nil { |
| 545 | return nil, err |
| 546 | } |
| 547 | relative, err := in.GetBool("relative") |
| 548 | if err != nil && !rc.IsErrParamNotFound(err) { |
| 549 | return nil, err |
| 550 | } |
| 551 | |
| 552 | // Set expiry |
| 553 | var refTime time.Time |
| 554 | if !relative { |
| 555 | refTime = time.Now() |
| 556 | } |
| 557 | err = vfs.cache.QueueSetExpiry(writeback.Handle(id), refTime, time.Duration(float64(time.Second)*expiry)) |
| 558 | return nil, err |
| 559 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…