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/con/ drwxr-xr-x | |
| Viewing file: Select action/file-type: const Queue = require('bull');
const redisConfig = {
port: 6379, // Default Redis port
host: 'solid-bull-34387.upstash.io', // Extracted from your UPSTASH_REDIS_URL
password: 'AYZTAAIjcDEwZjllMzMxMTEwN2Q0MmJlYTExMjllN2RmMjQzZTlmOXAxMA',
tls: {
rejectUnauthorized: false, // Necessary for Upstash Redis
},
};
const myFirstQueue = new Queue('notifications', {
redis: redisConfig,
});
// const myFirstQueue = new Queue('notifications',
// 'redis://127.0.0.1:6379');
// 'rediss://:AYZTAAIjcDEwZjllMzMxMTEwN2Q0MmJlYTExMjllN2RmMjQzZTlmOXAxMA@solid-bull-34387.upstash.io:6379');
// const myFirstQueue = new Queue('notifications', { redis: { port: 6379, host: 'solid-bull-34387.upstash.io', password: 'AYZTAAIjcDEwZjllMzMxMTEwN2Q0MmJlYTExMjllN2RmMjQzZTlmOXAxMA' } }); // Specify Redis connection using object
console.log(myFirstQueue);
myFirstQueue.add({ task: 'process-data'})
.then(() => {
console.log('Job added to the queue');
})
.catch((err) => {
console.error('Error adding job:', err);
});
myFirstQueue.process(async (job) => {
console.log('Processing job:', job.data);
return `Job ${job.id} processed successfully`;
});
// const Redis = require('ioredis');
// const redisClient = new Redis({
// host: '139.59.127.108', // Replace with the Ubuntu server's IP
// port: 6379,
// // password: 'your-strong-password', // Replace with your Redis password
// tls: false, // Set to true if TLS is enabled
// });
// // Test the connection
// redisClient.ping()
// .then((result) => {
// console.log('Connected to Redis:', result); // Should print "PONG"
// })
// .catch((err) => {
// console.error('Failed to connect to Redis:', err);
// });
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]-- |