mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: add -skip-unused support for vweb.run_at too (#18884)
This commit is contained in:
parent
63867d4ce0
commit
8c8d21d130
@ -2261,7 +2261,7 @@ fn (mut c Checker) post_process_generic_fns() ! {
|
|||||||
for concrete_types in gtypes {
|
for concrete_types in gtypes {
|
||||||
c.table.cur_concrete_types = concrete_types
|
c.table.cur_concrete_types = concrete_types
|
||||||
c.fn_decl(mut node)
|
c.fn_decl(mut node)
|
||||||
if node.name == 'vweb.run' {
|
if node.name in ['vweb.run', 'vweb.run_at'] {
|
||||||
for ct in concrete_types {
|
for ct in concrete_types {
|
||||||
if ct !in c.vweb_gen_types {
|
if ct !in c.vweb_gen_types {
|
||||||
c.vweb_gen_types << ct
|
c.vweb_gen_types << ct
|
||||||
|
3
vlib/v/tests/skip_unused/vweb_run_at.run.out
Normal file
3
vlib/v/tests/skip_unused/vweb_run_at.run.out
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Vweb] Running app on http://localhost:38090/
|
||||||
|
[Vweb] We have 1 workers
|
||||||
|
done
|
3
vlib/v/tests/skip_unused/vweb_run_at.skip_unused.run.out
Normal file
3
vlib/v/tests/skip_unused/vweb_run_at.skip_unused.run.out
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Vweb] Running app on http://localhost:38090/
|
||||||
|
[Vweb] We have 1 workers
|
||||||
|
done
|
21
vlib/v/tests/skip_unused/vweb_run_at.vv
Normal file
21
vlib/v/tests/skip_unused/vweb_run_at.vv
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import vweb
|
||||||
|
import time
|
||||||
|
|
||||||
|
struct App {
|
||||||
|
vweb.Context
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
spawn fn () {
|
||||||
|
time.sleep(100 * time.millisecond)
|
||||||
|
println('done')
|
||||||
|
exit(0)
|
||||||
|
}()
|
||||||
|
vweb.run_at(&App{}, port: 38090, nr_workers: 1)!
|
||||||
|
// vweb.run(&App{}, 38091)
|
||||||
|
}
|
||||||
|
|
||||||
|
['/']
|
||||||
|
pub fn (mut app App) app_main() vweb.Result {
|
||||||
|
return app.text('Hello World')
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user