@@ -57,15 +57,12 @@ impl DatabaseRevisionEditor {
5757 pub async fn new (
5858 database_id : & str ,
5959 user : Arc < dyn DatabaseUser > ,
60- mut rev_manager : RevisionManager < Arc < ConnectionPool > > ,
60+ database_pad : Arc < RwLock < DatabaseRevisionPad > > ,
61+ rev_manager : RevisionManager < Arc < ConnectionPool > > ,
6162 persistence : Arc < BlockIndexCache > ,
6263 task_scheduler : Arc < RwLock < TaskDispatcher > > ,
6364 ) -> FlowyResult < Arc < Self > > {
64- let token = user. token ( ) ?;
65- let cloud = Arc :: new ( GridRevisionCloudService { token } ) ;
66- let database_pad = rev_manager. initialize :: < GridRevisionSerde > ( Some ( cloud) ) . await ?;
6765 let rev_manager = Arc :: new ( rev_manager) ;
68- let database_pad = Arc :: new ( RwLock :: new ( database_pad) ) ;
6966 let cell_data_cache = AnyTypeCache :: < u64 > :: new ( ) ;
7067
7168 // Block manager
@@ -891,7 +888,7 @@ impl RevisionObjectDeserializer for GridRevisionSerde {
891888 Ok ( pad)
892889 }
893890
894- fn recover_operations_from_revisions ( _revisions : Vec < Revision > ) -> Option < Self :: Output > {
891+ fn recover_from_revisions ( _revisions : Vec < Revision > ) -> Option < ( Self :: Output , i64 ) > {
895892 None
896893 }
897894}
@@ -901,11 +898,18 @@ impl RevisionObjectSerializer for GridRevisionSerde {
901898 Ok ( operations. json_bytes ( ) )
902899 }
903900}
904- struct GridRevisionCloudService {
901+
902+ pub struct GridRevisionCloudService {
905903 #[ allow( dead_code) ]
906904 token : String ,
907905}
908906
907+ impl GridRevisionCloudService {
908+ pub fn new ( token : String ) -> Self {
909+ Self { token }
910+ }
911+ }
912+
909913impl RevisionCloudService for GridRevisionCloudService {
910914 #[ tracing:: instrument( level = "trace" , skip( self ) ) ]
911915 fn fetch_object ( & self , _user_id : & str , _object_id : & str ) -> FutureResult < Vec < Revision > , FlowyError > {
0 commit comments