mirror of
https://gittea.dev/nova/th.git
synced 2025-10-22 02:40:15 -04:00
delta time to reload directory
This commit is contained in:
13
main.c
13
main.c
@@ -60,6 +60,11 @@ int main(){
|
||||
|
||||
char threading = 0;
|
||||
terminal_width_empty_line = malloc(terminal_width);
|
||||
#if SETTINGS_RELOAD_DIR_DELTA != 0
|
||||
time_t t;
|
||||
time_t dt;
|
||||
time(&t);
|
||||
#endif
|
||||
|
||||
pthread_create(&thread_t, NULL, thread_top, &status); /*top bar*/
|
||||
pthread_create(&thread_l, NULL, thread_lft, &status); /*parent_content slash win_l*/
|
||||
@@ -92,6 +97,14 @@ int main(){
|
||||
|
||||
render_pass();
|
||||
|
||||
#if SETTINGS_RELOAD_DIR_DELTA != 0
|
||||
time(&dt);
|
||||
if (dt - t >= SETTINGS_RELOAD_DIR_DELTA) {
|
||||
time(&t);
|
||||
status |= (STATUS_RUN_BACKEND | STATUS_RELOAD_DIRECTORY);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
threading_free();
|
||||
free(start_path);
|
||||
|
Reference in New Issue
Block a user