Skip to content

Commit d2d899c

Browse files
Update app.js
1 parent c2ffc3e commit d2d899c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

app.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,20 @@ const http = require('http');
6666

6767

6868

69-
app.get('/', function (req, res) {
70-
mongoose.connect("mongo linki", function (err,db) {
69+
setInterval(() => {
70+
mongoose.connect("Mongo Adresi", function (err,db) {
7171
var users=db.collection("sites");
7272
users.find({}).toArray(function (err, result){
73-
result.forEach(function(site){
74-
setInterval(() => {
75-
http.get(site.site_link);
76-
}, 280000);
73+
result.forEach(site =>{
74+
if(!site) return;
75+
try {
76+
fetch(site.site_link)
77+
console.log("Pinglenen Site:" + site.site_link)
78+
} catch(e) { console.log("" + e) };
7779
})
7880
})
7981
});
80-
});
82+
}, 60000)
8183

8284

8385

0 commit comments

Comments
 (0)