Merge commit '51587ca3b289b66d479fcf1158728c5ff45196f6' into v3.x

isekai-main
Misty Release Bot 1 year ago
commit f68a5644dd

@ -1,3 +1,29 @@
#### v3.3.2 (2023-08-18)
##### Chores
* incrementing version number - v3.3.1 (151cc68f)
* update changelog for v3.3.1 (6f961f9c)
* incrementing version number - v3.3.0 (fc1ad70f)
* incrementing version number - v3.2.3 (b06d3e63)
* incrementing version number - v3.2.2 (758ecfcd)
* incrementing version number - v3.2.1 (20145074)
* incrementing version number - v3.2.0 (9ecac38e)
* incrementing version number - v3.1.7 (0b4e81ab)
* incrementing version number - v3.1.6 (b3a3b130)
* incrementing version number - v3.1.5 (ec19343a)
* incrementing version number - v3.1.4 (2452783c)
* incrementing version number - v3.1.3 (3b4e9d3f)
* incrementing version number - v3.1.2 (40fa3489)
* incrementing version number - v3.1.1 (40250733)
* incrementing version number - v3.1.0 (0cb386bd)
* incrementing version number - v3.0.1 (26f6ea49)
* incrementing version number - v3.0.0 (224e08cd)
##### Bug Fixes
* upgrade script (c02f1d70)
#### v3.3.1 (2023-08-18)
##### Chores

@ -44,7 +44,7 @@ connection.getConnectionString = function (mongo) {
connection.getConnectionOptions = function (mongo) {
mongo = mongo || nconf.get('mongo');
const connOptions = {
maxPoolSize: 10,
maxPoolSize: 20,
minPoolSize: 3,
connectTimeoutMS: 90000,
};

@ -574,7 +574,7 @@ module.exports = function (module) {
if (processFn && processFn.constructor && processFn.constructor.name !== 'AsyncFunction') {
processFn = util.promisify(processFn);
}
let iteration = 1;
while (!done) {
/* eslint-disable no-await-in-loop */
const item = await cursor.next();
@ -585,12 +585,12 @@ module.exports = function (module) {
}
if (ids.length >= options.batch || (done && ids.length !== 0)) {
await processFn(ids);
ids.length = 0;
if (options.interval) {
if (iteration > 1 && options.interval) {
await sleep(options.interval);
}
await processFn(ids);
iteration += 1;
ids.length = 0;
}
}
};

@ -28,6 +28,8 @@ connection.getConnectionOptions = function (postgres) {
password: postgres.password,
database: postgres.database,
ssl: String(postgres.ssl) === 'true',
max: 20,
connectionTimeoutMillis: 90000,
};
return _.merge(connOptions, postgres.options || {});

@ -677,7 +677,7 @@ SELECT z."value", z."score"
if (process && process.constructor && process.constructor.name !== 'AsyncFunction') {
process = util.promisify(process);
}
let iteration = 1;
while (true) {
/* eslint-disable no-await-in-loop */
let rows = await cursor.readAsync(batchSize);
@ -692,14 +692,15 @@ SELECT z."value", z."score"
rows = rows.map(r => r.value);
}
try {
if (iteration > 1 && options.interval) {
await sleep(options.interval);
}
await process(rows);
iteration += 1;
} catch (err) {
await client.release();
throw err;
}
if (options.interval) {
await sleep(options.interval);
}
}
};
};

@ -20,10 +20,13 @@ module.exports = {
// calculate user count and set progress.total
await batch.processArray(allRoomIds, async (roomIds) => {
await Promise.all(roomIds.map(async (roomId) => {
const userCount = await db.sortedSetCard(`chat:room:${roomId}:uids`);
await db.setObjectField(`chat:room:${roomId}`, 'userCount', userCount);
progress.total += userCount;
const arrayOfRoomData = await db.getObjects(roomIds.map(roomId => `chat:room:${roomId}`));
await Promise.all(roomIds.map(async (roomId, idx) => {
const roomData = arrayOfRoomData[idx];
if (roomData) {
const userCount = await db.sortedSetCard(`chat:room:${roomId}:uids`);
progress.total += userCount;
}
}));
}, {
batch: 500,
@ -74,6 +77,8 @@ module.exports = {
}, {
batch: 500,
});
const userCount = await db.sortedSetCard(`chat:room:${roomId}:uids`);
await db.setObjectField(`chat:room:${roomId}`, 'userCount', userCount);
}
}
}, {

@ -1,13 +1,11 @@
<div id="post-tooltip" class="card card-body shadow text-bg-light" style="position:absolute; z-index: 1;">
<div class="clearfix">
<div class="icon float-start">
<div id="post-tooltip" class="card card-body shadow bg-body text-body z-1 position-absolute">
<div class="d-flex flex-column gap-2">
<div class="d-flex gap-1 align-items-center">
<a href="{{{ if post.user.userslug }}}{config.relative_path}/user/{post.user.userslug}{{{ else }}}#{{{ end }}}">
{buildAvatar(post.user, "24px", true, "", "user/picture")} {post.user.username}
</a>
<span class="timeago text-xs" title="{post.timestampISO}"></span>
</div>
<small class="float-end">
<span class="timeago" title="{post.timestampISO}"></span>
</small>
<div class="content">{post.content}</div>
</div>
<div class="content">{post.content}</div>
</div>

Loading…
Cancel
Save