mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-10 15:38:35 +02:00
fix incremental
This commit is contained in:
@@ -397,7 +397,13 @@ export default class Repository {
|
|||||||
this._model.lastView = new Date();
|
this._model.lastView = new Date();
|
||||||
this._model.pageView = (this._model.pageView || 0) + 1;
|
this._model.pageView = (this._model.pageView || 0) + 1;
|
||||||
if (!isConnected) return this.model;
|
if (!isConnected) return this.model;
|
||||||
await this._model.save();
|
await AnonymizedRepositoryModel.updateOne(
|
||||||
|
{ _id: this._model._id },
|
||||||
|
{
|
||||||
|
$set: { lastView: this._model.lastView },
|
||||||
|
$inc: { pageView: 1 },
|
||||||
|
}
|
||||||
|
).exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user