Skip to content

Commit

Permalink
fix: import notion file base cases (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy authored Nov 2, 2024
1 parent 7c42cee commit a5a5a6b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ debug = true
[patch.crates-io]
# It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate.
# So using patch to workaround this issue.
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "4175465382020f1bd9cd9aa0e0766178eac7b4e5" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }
collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "be6bb90faac22ca8443a950ea3deafc7ec99b3a8" }

[features]
history = []
Expand Down
10 changes: 6 additions & 4 deletions services/appflowy-worker/src/import_worker/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ fn is_task_expired(timestamp: i64, last_process_at: Option<i64>) -> bool {
}

let elapsed = now - created_at;
let minutes = get_env_var("APPFLOWY_WORKER_IMPORT_TASK_EXPIRE_MINUTES", "10")
let minutes = get_env_var("APPFLOWY_WORKER_IMPORT_TASK_EXPIRE_MINUTES", "20")
.parse::<i64>()
.unwrap_or(10);
.unwrap_or(20);
elapsed.num_minutes() >= minutes
},
}
Expand Down Expand Up @@ -1314,14 +1314,16 @@ pub struct NotionImportTask {
pub md5_base64: Option<String>,
#[serde(default)]
pub last_process_at: Option<i64>,
#[serde(default)]
pub file_size: Option<i64>,
}

impl Display for NotionImportTask {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"NotionImportTask {{ task_id: {}, workspace_id: {}, workspace_name: {}, user_name: {}, user_email: {} }}",
self.task_id, self.workspace_id, self.workspace_name, self.user_name, self.user_email
"NotionImportTask {{ task_id: {}, workspace_id: {}, file_size:{:?}, workspace_name: {}, user_name: {}, user_email: {} }}",
self.task_id, self.workspace_id, self.file_size, self.workspace_name, self.user_name, self.user_email
)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/api/data_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async fn create_import_handler(
"user_email": user_email,
"task_id": task_id.to_string(),
"workspace_id": workspace_id,
"file_size":params.content_length,
"created_at": timestamp,
"s3_key": s3_key,
"host": host,
Expand Down

0 comments on commit a5a5a6b

Please sign in to comment.