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