@@ -59,46 +59,6 @@ pub const INTERNAL_STREAM_NAME: &str = "pmeta";
59
59
60
60
const CLUSTER_METRICS_INTERVAL_SECONDS : Interval = clokwerk:: Interval :: Minutes ( 1 ) ;
61
61
62
- pub async fn sync_cache_with_ingestors (
63
- url : & str ,
64
- ingestor : IngestorMetadata ,
65
- body : bool ,
66
- ) -> Result < ( ) , StreamError > {
67
- if !utils:: check_liveness ( & ingestor. domain_name ) . await {
68
- return Ok ( ( ) ) ;
69
- }
70
- let request_body: Bytes = Bytes :: from ( body. to_string ( ) ) ;
71
- let client = reqwest:: Client :: new ( ) ;
72
- let resp = client
73
- . put ( url)
74
- . header ( header:: CONTENT_TYPE , "application/json" )
75
- . header ( header:: AUTHORIZATION , ingestor. token )
76
- . body ( request_body)
77
- . send ( )
78
- . await
79
- . map_err ( |err| {
80
- // log the error and return a custom error
81
- log:: error!(
82
- "Fatal: failed to set cache: {}\n Error: {:?}" ,
83
- ingestor. domain_name,
84
- err
85
- ) ;
86
- StreamError :: Network ( err)
87
- } ) ?;
88
-
89
- // if the response is not successful, log the error and return a custom error
90
- // this could be a bit too much, but we need to be sure it covers all cases
91
- if !resp. status ( ) . is_success ( ) {
92
- log:: error!(
93
- "failed to set cache: {}\n Response Returned: {:?}" ,
94
- ingestor. domain_name,
95
- resp. text( ) . await
96
- ) ;
97
- }
98
-
99
- Ok ( ( ) )
100
- }
101
-
102
62
// forward the create/update stream request to all ingestors to keep them in sync
103
63
pub async fn sync_streams_with_ingestors (
104
64
headers : HeaderMap ,
@@ -122,7 +82,7 @@ pub async fn sync_streams_with_ingestors(
122
82
continue ;
123
83
}
124
84
let url = format ! (
125
- "{}{}/logstream/{}" ,
85
+ "{}{}/logstream/{}/sync " ,
126
86
ingestor. domain_name,
127
87
base_path_without_preceding_slash( ) ,
128
88
stream_name
@@ -176,7 +136,7 @@ pub async fn sync_users_with_roles_with_ingestors(
176
136
continue ;
177
137
}
178
138
let url = format ! (
179
- "{}{}/user/{}/role" ,
139
+ "{}{}/user/{}/role/sync " ,
180
140
ingestor. domain_name,
181
141
base_path_without_preceding_slash( ) ,
182
142
username
@@ -224,7 +184,7 @@ pub async fn sync_user_deletion_with_ingestors(username: &String) -> Result<(),
224
184
continue ;
225
185
}
226
186
let url = format ! (
227
- "{}{}/user/{}" ,
187
+ "{}{}/user/{}/sync " ,
228
188
ingestor. domain_name,
229
189
base_path_without_preceding_slash( ) ,
230
190
username
@@ -285,7 +245,7 @@ pub async fn sync_user_creation_with_ingestors(
285
245
continue ;
286
246
}
287
247
let url = format ! (
288
- "{}{}/user/{}" ,
248
+ "{}{}/user/{}/sync " ,
289
249
ingestor. domain_name,
290
250
base_path_without_preceding_slash( ) ,
291
251
username
@@ -333,7 +293,7 @@ pub async fn sync_password_reset_with_ingestors(username: &String) -> Result<(),
333
293
continue ;
334
294
}
335
295
let url = format ! (
336
- "{}{}/user/{}/generate-new-password" ,
296
+ "{}{}/user/{}/generate-new-password/sync " ,
337
297
ingestor. domain_name,
338
298
base_path_without_preceding_slash( ) ,
339
299
username
@@ -389,7 +349,7 @@ pub async fn sync_role_update_with_ingestors(
389
349
continue ;
390
350
}
391
351
let url = format ! (
392
- "{}{}/role/{}" ,
352
+ "{}{}/role/{}/sync " ,
393
353
ingestor. domain_name,
394
354
base_path_without_preceding_slash( ) ,
395
355
name
0 commit comments