setInterval(() => {

}, 15000);
const ProcessManager = require('./ProcessManager');
const helper = require('./src/helper');
const HttpClient = require('./src/HttpClient');
const redis_help = require('./src/use_redis'); 
const tools = require('./tools');
redis_help.connect( async (results)=>{
    if(results){
        // main()
        console.log("results:",await redis_help.getKeyValue("isPauseTask"))
    }
})

// let get_hy_group_mapping = require('./src/api/hy/get_hy_group_mapping');
// get_hy_group_mapping.get_group_mapping((data)=>{
//     if(data.code==200){
//         let list = data.data
//     }
//     console.log("get_hy_group_mapping:",data)
// })

// setTimeout( async ()=>{
//     let black_books = await redis_help.getKeyValue("all_black_books")
//     console.log("black_books:",black_books)
// },5000)
// let main = async function(){
//     let test = new HttpClient()
//     const postData = {
//         cmd:"create_link",
//         name:"台风夜老婆去救男秘书",
//         bookId:"1848991033902665730",
//         topUpTemplateId:"1854833762266247169",
//         passBackTemplateId:"6",
//         paidPoint:"9999999",
//         token:await tools.getHyToken()
//     };

//     let data = {
//         "name": postData.name,
//         "bookId": postData.bookId,
//         "passBackTemplateId":  postData.passBackTemplateId,
//         "adPassbackTemplateId": "",
//         "topUpTemplateId": postData.topUpTemplateId,
//         "mediaChannel": "1",
//         "group": "35", 
//         "paidPoint": postData.paidPoint,
//         "site": "5" 
//     }
//     let res =  await test.otherPost( helper.getHyCreateLinkOpt(postData.token) ,data)
//     console.log("res:",res)

//     let response = {
//         "message": "create_link successfully",
//         "received_data":{"originalId":res["data"]["originalId"],
//                          "appId":res["data"]["appId"],
//                          "launchPath":res["data"]["launchPath"],
//                          "fullPath":res["data"]["fullPath"],
//                          "wxMountLink":res["data"]["wxMountLink"]}
//     }
//     console.log("response:",response)
// }


// var main = function(){
//     require("./2_PRODUCT_FACTORY/PRODUCT_FACTORY")
//     require("./5_CREATE_LINK_FACTORY/CREATE_LINK_FACTORY")
//     require("./MAIN_SERVE_FACTORY/MAIN_SERVE_FACTORY")
//     require("./0_RECEIVE_FACTORY/RECEIVE_FACTORY")
//     require("./1_FILTER_FACTORY/FILTER_FACTORY")
// }


// let main = function(){
//     let manager = new ProcessManager()
//     manager.start()
//     manager.workers.forEach((v,k)=>{
//         if (v.process) {
//             v.process.send({ 
//                 type: 'config', 
//                 data: { /* 配置数据 */ } 
//             });
//         }
//     })
// }

