Minor changes

This commit is contained in:
Loic Guegan 2023-07-15 20:51:45 +02:00
parent 3ed96f9c9a
commit 087253ca04
4 changed files with 7 additions and 5 deletions

3
.gitignore vendored
View file

@ -5,4 +5,5 @@
# Caches
/logs
/data
/data
/pid

View file

@ -15,8 +15,9 @@ logger: src/logger.c src/utils.c
$(CC) $^ -o $@
publish: publisher logger
./logger $(LOGGERS_DIR) 587 $(LOG_INTERVAL) &
./publisher $(LOGGERS_DIR) $(LOG_INTERVAL) $(SUBSCRIBER_ADDR) $(ZMQ_PORT) $(KEY) &
rm -f pid
./logger $(LOGGERS_DIR) 587 $(LOG_INTERVAL) &> $(LOGGERS_DIR)/587.log & echo $$! >> pid
./publisher $(LOGGERS_DIR) $(LOG_INTERVAL) $(SUBSCRIBER_ADDR) $(ZMQ_PORT) $(KEY)
subscribe: subscriber
./subscriber $(ZMQ_PORT) $(SUBSCRIBER_DIR)

View file

@ -70,7 +70,7 @@ int main (int argc, char *argv [])
fprintf(logptr,"%ld,%d\n",TIMESTAMP(),power);
fseek(regptr,0,SEEK_SET);
sleep(1);
printf("Tick\n");
printf("Tick\n"); fflush(stdout);
}
fclose(logptr);
}

View file

@ -62,7 +62,7 @@ int main (int argc, char *argv [])
// Send current one
if(FILE_EXISTS(logfile)){
publish(publisher,logfile,client,interval);
//remove(logfile);
remove(logfile);
}
}
}