Extends the expiry on a revision backup. If this fails w/ key not found, will attempt to recreate the revision backup when body is non-empty.
(ctx context.Context, docid string, revid string, body []byte, expiry uint32, channels base.Set, deleted bool)
| 365 | |
| 366 | // Extends the expiry on a revision backup. If this fails w/ key not found, will attempt to recreate the revision backup when body is non-empty. |
| 367 | func (db *DatabaseCollectionWithUser) refreshOldRevisionJSON(ctx context.Context, docid string, revid string, body []byte, expiry uint32, channels base.Set, deleted bool) error { |
| 368 | _, err := db.dataStore.Touch(oldRevisionKey(docid, revid), expiry) |
| 369 | if base.IsDocNotFoundError(err) && len(body) > 0 { |
| 370 | return db.setOldRevisionJSON(ctx, docid, revid, body, deleted, expiry, channels) |
| 371 | } |
| 372 | return err |
| 373 | } |
| 374 | |
| 375 | // Currently only used by unit tests - deletes an archived old revision from the database |
| 376 | func (c *DatabaseCollection) PurgeOldRevisionJSON(ctx context.Context, docid string, revid string) error { |
no test coverage detected