Skip to content

Commit

Permalink
fix(cmd): fix quota implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimifr committed Jan 22, 2025
1 parent 0eb4676 commit 80a7586
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions cmd/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,22 @@ func runQuota(cmd *cobra.Command, args []string) {

httpClient := &http.Client{Timeout: 10 * time.Second}

for _, remoteConfigMap := range rcloneConfigFile {
for remoteName := range remoteConfigMap {
client, err := azure.NewAzureClientFromRcloneConfigData(configData, remoteName)
if err != nil {
fmt.Printf("Failed to initialize client for remote '%s': %v\n", remoteName, err)
continue
}

quota, err := client.GetDriveQuota(httpClient)
if err != nil {
fmt.Printf("Failed to fetch quota information for remote '%s': %v\n", remoteName, err)
continue
}

azure.DisplayQuotaInfo(remoteName, quota)
availRemotes := azure.GetAvailableRemotes(&rcloneConfigFile)

for _, remoteName := range availRemotes {
fmt.Println("current remote:", remoteName)
client, err := azure.NewAzureClientFromRcloneConfigData(configData, remoteName)
if err != nil {
fmt.Printf("Failed to initialize client for remote '%s': %v\n", remoteName, err)
continue
}

quota, err := client.GetDriveQuota(httpClient)
if err != nil {
fmt.Printf("Failed to fetch quota information for remote '%s': %v\n", remoteName, err)
continue
}

azure.DisplayQuotaInfo(remoteName, quota)
}
}

0 comments on commit 80a7586

Please sign in to comment.