mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-01 15:12:40 +00:00
Merge pull request #1067 from naturalcrit/compress
Fix Shared View uncompressing brew text
This commit is contained in:
@@ -37,7 +37,7 @@ const junkBrewQuery = HomebrewModel.find({
|
|||||||
|
|
||||||
/* Search for brews that aren't compressed (missing the compressed text field) */
|
/* Search for brews that aren't compressed (missing the compressed text field) */
|
||||||
const uncompressedBrewQuery = HomebrewModel.find({
|
const uncompressedBrewQuery = HomebrewModel.find({
|
||||||
'textBin' : null
|
'text' : { '$exists': true }
|
||||||
}).lean().limit(10000).select('_id');
|
}).lean().limit(10000).select('_id');
|
||||||
|
|
||||||
router.get('/admin/cleanup', mw.adminOnly, (req, res)=>{
|
router.get('/admin/cleanup', mw.adminOnly, (req, res)=>{
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ HomebrewSchema.methods.increaseView = function(){
|
|||||||
return new Promise((resolve, reject)=>{
|
return new Promise((resolve, reject)=>{
|
||||||
this.lastViewed = new Date();
|
this.lastViewed = new Date();
|
||||||
this.views = this.views + 1;
|
this.views = this.views + 1;
|
||||||
|
this.text = undefined;
|
||||||
this.save((err)=>{
|
this.save((err)=>{
|
||||||
if(err) return reject(err);
|
if(err) return reject(err);
|
||||||
return resolve(this);
|
return resolve(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user