Adds a revision body (as []byte) to a document. Flags for external storage when appropriate
(revid string, body []byte, storeInline bool, hasAttachments bool)
| 848 | |
| 849 | // Adds a revision body (as []byte) to a document. Flags for external storage when appropriate |
| 850 | func (doc *Document) setNonWinningRevisionBody(revid string, body []byte, storeInline bool, hasAttachments bool) { |
| 851 | revBodyKey := "" |
| 852 | if !storeInline && len(body) > MaximumInlineBodySize { |
| 853 | revBodyKey = generateRevBodyKey(doc.ID, revid) |
| 854 | doc.addedRevisionBodies = append(doc.addedRevisionBodies, revid) |
| 855 | } |
| 856 | doc.History.setRevisionBody(revid, body, revBodyKey, hasAttachments) |
| 857 | } |
| 858 | |
| 859 | // persistModifiedRevisionBodies writes new non-inline revisions to the bucket. |
| 860 | // Should be invoked BEFORE the document is successfully committed. |
no test coverage detected