Don't push artifacts to remote caches that already contain them
This adds two separate checks to avoid pushing artifacts unnecessarily. First, in the OSTreeCache.push() method we now first obtain the list of remotes that contain the refs that we are about to push. We then avoid pushing to any remote that already contains that ref. Note that the internal ref map is read once on process startup, so if multiple `bst` processes are pushing to a cache they might still both push the same artifact. There is an existing issue for this: #179 Secondly the Element._skip_push() method now checks if all remote caches configured for pushing already have a given artifact, and will skip the push job altogether if they do. The first check would already mean that no pushes would actually happen, but without the second check the user would still see Push jobs being created for every artifact which would be quite misleading.
Loading
Please register or sign in to comment