This commit is contained in:
Liang Ding 2023-04-22 18:56:38 +08:00
parent 0dcca1ec23
commit a2fae4dce1
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 7 additions and 4 deletions

View file

@ -69,7 +69,7 @@ type TypeCount struct {
Count int `json:"count"`
}
func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc bool, err error) {
func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc bool, updated int64, err error) {
if 1 > len(Conf.Repo.Key) {
err = errors.New(Conf.Language(26))
return
@ -80,7 +80,7 @@ func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc
return
}
luteEngine := NewLute()
isLargeDoc, snapshotTree, err := parseTreeInSnapshot(fileID, repo, luteEngine)
isLargeDoc, snapshotTree, updated, err := parseTreeInSnapshot(fileID, repo, luteEngine)
if nil != err {
logging.LogErrorf("parse tree from snapshot file [%s] failed", fileID)
return
@ -270,7 +270,7 @@ func parseTitleInSnapshot(fileID string, repo *dejavu.Repo, luteEngine *lute.Lut
return
}
func parseTreeInSnapshot(fileID string, repo *dejavu.Repo, luteEngine *lute.Lute) (isLargeDoc bool, tree *parse.Tree, err error) {
func parseTreeInSnapshot(fileID string, repo *dejavu.Repo, luteEngine *lute.Lute) (isLargeDoc bool, tree *parse.Tree, updated int64, err error) {
file, err := repo.GetFile(fileID)
if nil != err {
return
@ -286,6 +286,8 @@ func parseTreeInSnapshot(fileID string, repo *dejavu.Repo, luteEngine *lute.Lute
if nil != err {
return
}
updated = file.Updated
return
}