update wa official API
This commit is contained in:
+12
-35
@@ -1,38 +1,3 @@
|
||||
// const { exec } = require('child_process');
|
||||
// const path = require('path');
|
||||
|
||||
// // Jalur ke executable PHP
|
||||
// const phpExecutablePath = '/www/server/php/74/bin/php'; // Jalur yang sesuai dengan sistem Anda
|
||||
|
||||
// // Daftar jalur ke file PHP
|
||||
// const phpScriptPaths = [
|
||||
// path.join(__dirname, 'load_pesan.php'),
|
||||
// path.join(__dirname, 'load_tagihan_flip.php'),
|
||||
// path.join(__dirname, 'create_link_flip.php'),
|
||||
// ];
|
||||
|
||||
// // Fungsi untuk menjalankan file PHP
|
||||
// function runPhpScripts() {
|
||||
// phpScriptPaths.forEach((phpScriptPath) => {
|
||||
// console.log(`Running command: ${phpExecutablePath} ${phpScriptPath}`);
|
||||
// exec(`${phpExecutablePath} ${phpScriptPath}`, (error, stdout, stderr) => {
|
||||
// if (error) {
|
||||
// console.error(`Error executing PHP script ${phpScriptPath}: ${error.message}`);
|
||||
// return;
|
||||
// }
|
||||
// if (stderr) {
|
||||
// console.error(`PHP script ${phpScriptPath} stderr: ${stderr}`);
|
||||
// return;
|
||||
// }
|
||||
// console.log(`PHP script ${phpScriptPath} output: ${stdout}`);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
// // Jalankan PHP scripts segera dan kemudian setiap 5 detik
|
||||
// runPhpScripts();
|
||||
// setInterval(runPhpScripts, 5000);
|
||||
|
||||
const { exec } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
@@ -47,6 +12,10 @@ const phpScriptPaths = [
|
||||
path.join(__dirname, 'load_tagihan_paydisini.php'),
|
||||
];
|
||||
|
||||
|
||||
// --- File tambahan setiap 1 detik ---
|
||||
const loadWAOfficialPath = path.join(__dirname, 'load_pesan_official.php');
|
||||
|
||||
// Fungsi untuk menjalankan 1 file PHP (Promise)
|
||||
function runPhpScript(phpScriptPath) {
|
||||
return new Promise((resolve) => {
|
||||
@@ -77,5 +46,13 @@ async function runPhpScripts() {
|
||||
setTimeout(runPhpScripts, nextDelay);
|
||||
}
|
||||
|
||||
// Fungsi loop cepat (1 detik)
|
||||
function runLoadWAOfficial() {
|
||||
runPhpScript(loadWAOfficialPath).then(() => {
|
||||
setTimeout(runLoadWAOfficial, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
// Jalankan pertama kali
|
||||
runPhpScripts();
|
||||
runLoadWAOfficial();
|
||||
|
||||
Reference in New Issue
Block a user