File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -70,18 +70,21 @@ pub fn get_path(conn: &Connection, path: &str) -> Option<Blob> {
7070 if rows. len ( ) == 0 {
7171 None
7272 } else {
73- let client = s3_client ( ) ;
7473 let row = rows. get ( 0 ) ;
75- let content = client. and_then ( |c| c. get_object ( GetObjectRequest {
76- bucket : "rust-docs-rs" . into ( ) ,
77- key : path. into ( ) ,
78- ..Default :: default ( )
79- } ) . sync ( ) . ok ( ) ) . and_then ( |r| r. body ) . map ( |b| {
80- let mut b = b. into_blocking_read ( ) ;
81- let mut content = Vec :: new ( ) ;
82- b. read_to_end ( & mut content) . unwrap ( ) ;
83- content
84- } ) . unwrap_or ( row. get ( 3 ) ) ;
74+ let mut content = row. get ( 3 ) ;
75+ if content == b"in-s3" {
76+ let client = s3_client ( ) ;
77+ content = client. and_then ( |c| c. get_object ( GetObjectRequest {
78+ bucket : "rust-docs-rs" . into ( ) ,
79+ key : path. into ( ) ,
80+ ..Default :: default ( )
81+ } ) . sync ( ) . ok ( ) ) . and_then ( |r| r. body ) . map ( |b| {
82+ let mut b = b. into_blocking_read ( ) ;
83+ let mut content = Vec :: new ( ) ;
84+ b. read_to_end ( & mut content) . unwrap ( ) ;
85+ content
86+ } ) . unwrap ( ) ;
87+ } ;
8588
8689 Some ( Blob {
8790 path : row. get ( 0 ) ,
You can’t perform that action at this time.
0 commit comments