|
|
@@ -25,7 +25,6 @@ class ActivityService {
|
|
|
|
|
|
this.updateByParameters = this.updateByParameters.bind(this);
|
|
|
|
|
|
- this.createTtlIndex();
|
|
|
this.initActivityEventListeners();
|
|
|
}
|
|
|
|
|
|
@@ -46,12 +45,13 @@ class ActivityService {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private createTtlIndex = async function() {
|
|
|
+ createTtlIndex = async function() {
|
|
|
const configManager = this.crowi.configManager;
|
|
|
const activityExpirationSeconds = configManager != null ? configManager.getConfig('crowi', 'app:activityExpirationSeconds') : 7776000;
|
|
|
const collection = mongoose.connection.collection('activities');
|
|
|
|
|
|
try {
|
|
|
+ throw Error('えらー');
|
|
|
const indexes = await collection.indexes();
|
|
|
const ttlIndex = indexes.find(i => i.name === 'createdAt_1');
|
|
|
const shoudCreateIndex = ttlIndex == null;
|