mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: save snapshot to sqlite db (#2718)
* chore: snapshot * chore: impl sqlite snapshot * feat: snapshot config * feat: update patch * ci: fix tauri ci * ci: add cache path * chore: save snapshot * chore: update patch * ci: fix s fmt
This commit is contained in:
@ -48,11 +48,12 @@ impl DatabaseManager2 {
|
||||
}
|
||||
|
||||
pub async fn initialize(&self, user_id: i64) -> FlowyResult<()> {
|
||||
let config = CollabPersistenceConfig::new().snapshot_per_update(10);
|
||||
let db = self.user.collab_db()?;
|
||||
*self.user_database.lock() = Some(InnerUserDatabase::new(
|
||||
user_id,
|
||||
db,
|
||||
CollabPersistenceConfig::default(),
|
||||
config,
|
||||
UserDatabaseCollabBuilderImpl(self.collab_builder.clone()),
|
||||
));
|
||||
// do nothing
|
||||
@ -269,16 +270,6 @@ unsafe impl Send for UserDatabase {}
|
||||
struct UserDatabaseCollabBuilderImpl(Arc<AppFlowyCollabBuilder>);
|
||||
|
||||
impl DatabaseCollabBuilder for UserDatabaseCollabBuilderImpl {
|
||||
fn build(
|
||||
&self,
|
||||
uid: i64,
|
||||
object_id: &str,
|
||||
object_name: &str,
|
||||
db: Arc<RocksCollabDB>,
|
||||
) -> Arc<MutexCollab> {
|
||||
self.0.build(uid, object_id, object_name, db)
|
||||
}
|
||||
|
||||
fn build_with_config(
|
||||
&self,
|
||||
uid: i64,
|
||||
|
@ -6,4 +6,5 @@ pub mod filter;
|
||||
pub mod group;
|
||||
pub mod setting;
|
||||
pub mod share;
|
||||
pub mod snapshot;
|
||||
pub mod sort;
|
||||
|
@ -0,0 +1 @@
|
||||
|
Reference in New Issue
Block a user