Fixes
parent: tbd commit: 74f247e
1 | use ; |
2 | |
3 | use ; |
4 | use |
5 | , | AuthenticationTokenGranter
6 | , |
7 | connection, listener, |
8 | ; |
9 | use Listeners; |
10 | use ; |
11 | use |
12 | , | File
13 | , |
14 | , |
15 | , | Mutex
16 | ; |
17 | use ; |
18 | use Table; |
19 | |
20 | |
21 | extern crate tracing; |
22 | |
23 | |
24 | async |
25 | ; | init
26 | let mut listener = bind .await?; |
27 | let connections: = default; |
28 | let listeners: = default; |
29 | let config: Table = |
30 | let mut file = open .await?; |
31 | let mut text = String new; |
32 | file.read_to_string .await?; |
33 | text.parse? |
34 | ; |
35 | let db_conn_options = new |
36 | .host |
37 | .port |
38 | .database |
39 | .username |
40 | .password |
41 | .log_statements; |
42 | let db_pool = connect_with .await?; |
43 | info!; |
44 | |
45 | let repository_backend: = new |
46 | let foo: GitBackend = GitBackend |
47 | pg_pool: db_pool, |
48 | repository_folder: String from, |
49 | ; |
50 | foo |
51 | ; |
52 | |
53 | let token_granter = new |
54 | config: config.clone, |
55 | ; |
56 | |
57 | info!; |
58 | |
59 | loop |
60 | let stream = accept_stream .await; |
61 | info!; |
62 | |
63 | let = match stream |
64 | Ok => stream, |
65 | Err => |
66 | error!; |
67 | continue; |
68 | |
69 | ; |
70 | |
71 | info!; |
72 | |
73 | let connection = accept_websocket_connection .await; |
74 | |
75 | let connection = match connection |
76 | Ok => connection, |
77 | Err => |
78 | error! |
79 | "Failed to initiate Websocket connection from {}. {:?}", |
80 | address, err |
81 | ; |
82 | continue; |
83 | |
84 | ; |
85 | |
86 | info!; |
87 | |
88 | let connection = RawConnection |
89 | task: spawn |
90 | connection, |
91 | listeners.clone, |
92 | connections.clone, |
93 | repository_backend.clone, |
94 | token_granter.clone, |
95 | address, |
96 | , |
97 | ; |
98 | |
99 | connections.lock .await.connections.push; |
100 | |
101 | |
102 | |
103 | async |
104 | listener: &mut TcpListener, |
105 | |
106 | let stream = listener.accept .await?; |
107 | |
108 | Ok |
109 | |
110 | |
111 | async |
112 | stream: S, |
113 | |
114 | let connection = accept_async .await?; |
115 | |
116 | Ok |
117 | |
118 |