Skip to content

Commit

Permalink
feat(services/yandex_disk): setup test for yandex disk
Browse files Browse the repository at this point in the history
  • Loading branch information
hoslo authored and shuai_yang committed Feb 25, 2024
1 parent a628a52 commit 36cbcb5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/services/yandex_disk/yandex_disk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: yandex_disk
description: 'Behavior test for Yandex Disk.'

runs:
using: "composite"
steps:
- name: Setup
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OPENDAL_YANDEX_DISK_ACCESS_TOKEN: op://services/yandex_disk/access_token
2 changes: 2 additions & 0 deletions core/src/services/yandex_disk/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) -> Result<Error> {
400 => (ErrorKind::InvalidInput, false),
410 | 403 => (ErrorKind::PermissionDenied, false),
404 => (ErrorKind::NotFound, false),
// We should retry it when we get 423 error.
423 => (ErrorKind::RateLimited, true),
499 => (ErrorKind::Unexpected, true),
503 | 507 => (ErrorKind::Unexpected, true),
_ => (ErrorKind::Unexpected, false),
Expand Down

0 comments on commit 36cbcb5

Please sign in to comment.