mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) revamp snapshot inventory
Summary: Deliberate changes: * save snapshots to s3 prior to migrations. * label migration snapshots in s3 metadata. * avoid pruning migration snapshots for a month. Opportunistic changes: * Associate document timezone with snapshots, so pruning can respect timezones. * Associate actionHash/Num with snapshots. * Record time of last change in snapshots (rather than just s3 upload time, which could be a while later). This ended up being a biggish change, because there was nowhere ideal to put tags (list of possibilities in diff). Test Plan: added tests Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2646
This commit is contained in:
@@ -337,16 +337,16 @@ export class DocManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
public markAsChanged(activeDoc: ActiveDoc) {
|
||||
if (!activeDoc.muted) {
|
||||
this.storageManager.markAsChanged(activeDoc.docName);
|
||||
public markAsChanged(activeDoc: ActiveDoc, reason?: 'edit') {
|
||||
// Ignore changes if document is muted or in the middle of a migration.
|
||||
if (!activeDoc.muted && !activeDoc.isMigrating()) {
|
||||
this.storageManager.markAsChanged(activeDoc.docName, reason);
|
||||
}
|
||||
}
|
||||
|
||||
public markAsEdited(activeDoc: ActiveDoc) {
|
||||
if (!activeDoc.muted) {
|
||||
this.storageManager.markAsEdited(activeDoc.docName);
|
||||
}
|
||||
public async makeBackup(activeDoc: ActiveDoc, name: string): Promise<string> {
|
||||
if (activeDoc.muted) { throw new Error('Document is disabled'); }
|
||||
return this.storageManager.makeBackup(activeDoc.docName, name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user