Compare commits
2
Commits
708c02b410
...
b895ce5a49
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b895ce5a49 | ||
|
|
b9a8d49063 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.254.2",
|
||||
"version": "1.254.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "traxxx",
|
||||
"version": "1.254.2",
|
||||
"version": "1.254.3",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.458.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.254.2",
|
||||
"version": "1.254.3",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
||||
+16
-6
@@ -26,6 +26,7 @@ const humanConfig = {
|
||||
|
||||
let humanInstance = null;
|
||||
const nsPerSec = 1e9;
|
||||
const remainingTimeWindow = 30; // number of recent entries used to estimate time remaining
|
||||
|
||||
async function getHumanInstance() {
|
||||
if (!humanInstance) {
|
||||
@@ -118,6 +119,7 @@ async function setBiometrics(actorIds, shouldUpdate = false, includePhotos = fal
|
||||
}
|
||||
|
||||
const startTime = process.hrtime();
|
||||
const recentDurationsMs = [];
|
||||
|
||||
const avatarSource = getAvatarSource(actorIds, includePhotos);
|
||||
|
||||
@@ -142,6 +144,8 @@ async function setBiometrics(actorIds, shouldUpdate = false, includePhotos = fal
|
||||
return;
|
||||
}
|
||||
|
||||
const entryStartTime = process.hrtime();
|
||||
|
||||
const biometrics = await getBiometrics(avatarEntry);
|
||||
|
||||
if (!biometrics) {
|
||||
@@ -184,14 +188,20 @@ async function setBiometrics(actorIds, shouldUpdate = false, includePhotos = fal
|
||||
.onConflict(['media_id', 'face_index'])
|
||||
.ignore();
|
||||
|
||||
const processed = avatarIndex + 1;
|
||||
const [elapsedSec, elapsedNs] = process.hrtime(startTime);
|
||||
const elapsedMs = (elapsedSec * nsPerSec + elapsedNs) / 1e6;
|
||||
const avgMsPerEntry = elapsedMs / processed;
|
||||
const remainingMs = avgMsPerEntry * (avatarEntries.length - processed);
|
||||
const [entrySec, entryNs] = process.hrtime(entryStartTime);
|
||||
const entryMs = (entrySec * nsPerSec + entryNs) / 1e6;
|
||||
|
||||
recentDurationsMs.push(entryMs);
|
||||
|
||||
if (recentDurationsMs.length > remainingTimeWindow) {
|
||||
recentDurationsMs.shift();
|
||||
}
|
||||
|
||||
const avgMsPerEntry = recentDurationsMs.reduce((sum, ms) => sum + ms, 0) / recentDurationsMs.length;
|
||||
const remainingMs = avgMsPerEntry * (avatarEntries.length - (avatarIndex + 1));
|
||||
const remainingMinutes = (remainingMs / 1000 / 60).toFixed(1);
|
||||
|
||||
logger.info(`Set biometrics for ${avatarEntry.media_id} (${processed}/${avatarEntries.length}, ~${remainingMinutes}m remaining)`);
|
||||
logger.info(`Set biometrics for ${avatarEntry.media_id} (${avatarIndex + 1}/${avatarEntries.length}, ~${remainingMinutes}m remaining)`);
|
||||
}, Promise.resolve());
|
||||
|
||||
const diffTime = process.hrtime(startTime);
|
||||
|
||||
Reference in New Issue
Block a user