mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
retry when ws connection lost
This commit is contained in:
@ -2,7 +2,7 @@ use std::{net::TcpListener, time::Duration};
|
||||
|
||||
use actix::Actor;
|
||||
use actix_identity::{CookieIdentityPolicy, IdentityService};
|
||||
use actix_web::{dev::Server, middleware, web, web::Data, App, HttpServer, Scope};
|
||||
use actix_web::{dev::Server, web, web::Data, App, HttpServer, Scope};
|
||||
use sqlx::{postgres::PgPoolOptions, PgPool};
|
||||
use tokio::time::interval;
|
||||
|
||||
@ -50,7 +50,7 @@ pub fn run(listener: TcpListener, app_ctx: AppContext) -> Result<Server, std::io
|
||||
|
||||
let server = HttpServer::new(move || {
|
||||
App::new()
|
||||
.wrap(middleware::Logger::default())
|
||||
// .wrap(middleware::Logger::default())
|
||||
.wrap(identify_service(&domain, &secret))
|
||||
.wrap(crate::middleware::default_cors())
|
||||
.wrap(crate::middleware::AuthenticationService)
|
||||
|
@ -82,7 +82,7 @@ impl ServerEditDoc {
|
||||
|
||||
#[tracing::instrument(
|
||||
level = "debug",
|
||||
skip(self, user, pg_pool),
|
||||
skip(self, user, pg_pool, revision),
|
||||
fields(
|
||||
rev_id = %self.rev_id.load(SeqCst),
|
||||
revision_rev_id = %revision.rev_id,
|
||||
@ -186,7 +186,7 @@ impl ServerEditDoc {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, pg_pool), err)]
|
||||
#[tracing::instrument(level = "debug", skip(self, revision, pg_pool), err)]
|
||||
async fn save_revision(&self, revision: &Revision, pg_pool: Data<PgPool>) -> Result<(), ServerError> {
|
||||
// Opti: save with multiple revisions
|
||||
let mut params = UpdateDocParams::new();
|
||||
|
@ -33,7 +33,6 @@ impl DocHandle {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, user, socket, revision))]
|
||||
pub async fn apply_revision(
|
||||
&self,
|
||||
user: Arc<WsUser>,
|
||||
|
Reference in New Issue
Block a user