# Multisite rake uploads task

**URL:** https://meta.discourse.org/t/multisite-rake-uploads-task/171716
**Category:** Development
**Tags:** pr-welcome
**Created:** [November 30, 2020, 10:55am UTC](https://meta.discourse.org/t/multisite-rake-uploads-task/171716 "2020-11-30T10:55:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [November 30, 2020, 10:55am UTC](https://meta.discourse.org/t/multisite-rake-uploads-task/171716/1 "2020-11-30T10:55:20Z")

</div>

Some `uploads` rake tasks have this pattern:

```plaintext
  RailsMultisite::ConnectionManagement.each_connection do |db|
    unless Discourse.store.external?
      puts "This task only works for external storage."
      exit 1
    end
    ...
    (actual code)
  end

```

This code exits the task completely when it encounters a non-external upload store.  
Shouldn’t it just skip the connection with `next` , instead of `exit` ?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 30, 2020, 10:50pm UTC](https://meta.discourse.org/t/multisite-rake-uploads-task/171716/2 "2020-11-30T22:50:21Z")

</div>

Technically … yes, but a multisite with a mix of internal and external storage is not really supported.

I guess we can just skip the loop here if you want to submit a PR.
