Skip to content

Commit

Permalink
x.templating.dtm: fix dtm clock test for CI (#20824)
Browse files Browse the repository at this point in the history
  • Loading branch information
GGRei committed Feb 14, 2024
1 parent 9476aed commit ed5c2f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
6 changes: 0 additions & 6 deletions vlib/x/templating/dtm/dynamic_template_manager.v
Expand Up @@ -1086,17 +1086,11 @@ fn (mut tm DynamicTemplateManager) handle_dtm_clock() {
break
}
else {
$if test {
break
}
// Attendre une seconde
time.sleep(1 * time.second)
}
}
}
$if test {
break
}
if need_to_close {
break
}
Expand Down
19 changes: 18 additions & 1 deletion vlib/x/templating/dtm/dynamic_template_manager_test.v
Expand Up @@ -354,7 +354,6 @@ fn test_handle_dtm_clock() {
defer {
dtmi.stop_cache_handler()
}
dtmi.handle_dtm_clock()
date_to_str := dtmi.c_time.str()
assert date_to_str.len > 10
}
Expand Down Expand Up @@ -416,5 +415,23 @@ fn (mut tm DynamicTemplateManager) create_cache() string {
html := tm.create_template_cache_and_display(.new, html_last_mod, c_time, temp_html_file,
dtm.temp_html_n, cache_delay_exp, &placeholder, content_checksum, TemplateType.html)
time.sleep(5 * time.millisecond)
lock tm.template_caches {
if tm.template_caches.len < 1 {
time.sleep(10 * time.millisecond)
}
/*
if tm.template_caches.len < 1 {
tm.template_caches << TemplateCache{
id: 1
path: temp_html_file
name: dtm.temp_html_n
generate_at: c_time
cache_delay_expiration: cache_delay_exp
last_template_mod: html_last_mod
checksum: '1a2b3c4d5e6f'
}
}
*/
}
return html
}

0 comments on commit ed5c2f3

Please sign in to comment.