Skip to content

Conversation

@alist666
Copy link
Contributor

@alist666 alist666 commented Jul 5, 2025

cloudreve 文件删除方法和修改refresh_token获取错误

…files and fix cloudreve refresh_token get error
@petercat-assistant
Copy link

Walkthrough: This PR enhances the file deletion handling in the Cloudreve driver by implementing a retry mechanism for lock conflicts, adds an option to hide files currently being uploaded, and fixes the refresh token retrieval error. Additionally, it changes the HTTP method for a callback request.

Changes:

File Summary
drivers/cloudreve_v4/driver.go Enhanced file deletion with retry on lock conflict, added filter to hide uploading files, fixed thumbnail condition, and corrected rename endpoint.
drivers/cloudreve_v4/meta.go Added HideUploading option to configuration.
drivers/cloudreve_v4/types.go Introduced constants for metadata keys, changed Metadata type, and added FileDeleteResp struct.
drivers/cloudreve_v4/util.go Fixed refresh token logic and changed callback request method from POST to GET.

return nil
}

// 若存在锁冲突,则先清除锁再重试

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The retry mechanism for lock conflicts in file deletion is a good addition. However, ensure that the error handling for the del() function is robust enough to handle unexpected errors beyond lock conflicts.

return fmt.Errorf("up status: %d, error: %s", res.StatusCode, string(body))
}

// 上传成功发送回调请求

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the HTTP method from POST to GET for the callback request might have implications on the server-side logic. Ensure that the server is configured to handle GET requests for this endpoint.

@skysliences skysliences self-requested a review July 14, 2025 02:16
ILoveScratch2

This comment was marked as outdated.

@skysliences skysliences requested a review from bbmacaa July 25, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants