mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-11-21 10:56:10 +00:00
fixed timers on FreeBSD
This commit is contained in:
@@ -342,6 +342,8 @@ int event_queue_add_timer(int eq, int *id, int sec) {
|
||||
|
||||
*id = timer_id ;
|
||||
timer_id++;
|
||||
|
||||
uwsgi_log("registering timer %d\n", sec);
|
||||
|
||||
EV_SET(&kev, *id, EVFILT_TIMER, EV_ADD, 0, sec*1000, 0);
|
||||
if (kevent(eq, &kev, 1, NULL, 0, NULL) < 0) {
|
||||
|
||||
@@ -425,6 +425,7 @@ void master_loop(char **argv, char **environ) {
|
||||
|
||||
for(i=0;i<uwsgi.timers_cnt;i++) {
|
||||
if (uwsgi.timers[i].registered) {
|
||||
uwsgi_log("%d = %d\n", interesting_fd, uwsgi.timers[i].fd);
|
||||
if (interesting_fd == uwsgi.timers[i].fd) {
|
||||
struct uwsgi_timer *ut = event_queue_ack_timer(interesting_fd, NULL);
|
||||
// now call the file_monitor handler
|
||||
|
||||
@@ -20,7 +20,7 @@ int register_signal(uint8_t sig, char *payload) {
|
||||
else {
|
||||
uwsgi_log("you can register max 64 file monitors !!!\n");
|
||||
}
|
||||
|
||||
break;
|
||||
case 11:
|
||||
if (uwsgi.timers_cnt < 64) {
|
||||
uwsgi.timers[uwsgi.timers_cnt].value = atoi(payload);
|
||||
@@ -35,6 +35,7 @@ int register_signal(uint8_t sig, char *payload) {
|
||||
else {
|
||||
uwsgi_log("you can register max 64 timers !!!\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import uwsgi
|
||||
|
||||
# send a raw signal to register with file_monitor subsystem
|
||||
uwsgi.signal(10, "/tmp/topolino")
|
||||
#uwsgi.signal(10, "/tmp/topolino")
|
||||
uwsgi.signal(10, "/tmp")
|
||||
uwsgi.signal(10, "/root")
|
||||
#uwsgi.signal(10, "/root")
|
||||
|
||||
# send a raw signal to register with timer subsystem
|
||||
uwsgi.signal(11, "3")
|
||||
|
||||
Reference in New Issue
Block a user