Commit 6eebcd9c authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 19187423
...@@ -15,20 +15,19 @@ const client = new Client({ ...@@ -15,20 +15,19 @@ const client = new Client({
let arr = [] let arr = []
app.get('/', (req, res) => { app.get('/', (req, res) => {
console.log('get file request') console.log('get file request')
res.sendfile('ikev2.mobileconfig') res.sendfile('ikev2.mobileconfig')
}) })
app.listen(process.env.PORT || 3000, () => console.log(`Example app listening on port ${port}!`)) app.listen(process.env.PORT || 3000, () => console.log(`Example app listening on port ${port}!`))
async function refresh() { async function refresh() {
try { try {
await client.connect() await client.connect()
} } catch (e) {
catch (e) { console.log(e)
}
}
let res = await client.query('select * from users As u,normal_users As n,user_attrs AS att where u.user_id=n.user_id and att.user_id=u.user_id and group_id=1') let res = await client.query('select * from users As u,normal_users As n,user_attrs AS att where u.user_id=n.user_id and att.user_id=u.user_id and group_id=1')
...@@ -58,8 +57,14 @@ catch (e) { ...@@ -58,8 +57,14 @@ catch (e) {
for (let i = 0; i < arr.length; i++) for (let i = 0; i < arr.length; i++)
last += arr[i] + '\n' last += arr[i] + '\n'
try {
await createfile(last) await createfile(last)
await execLast() await execLast()
} catch (e) {
}
// try { // try {
// await client.end() // await client.end()
// } // }
...@@ -67,9 +72,8 @@ catch (e) { ...@@ -67,9 +72,8 @@ catch (e) {
// //
// } // }
}
}
cron.schedule(' */30 * * * * *', () => { cron.schedule(' */30 * * * * *', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment