Module: PatchedResource
- Defined in:
- lib/patched/storage.rb
Instance Method Summary collapse
-
#delete(key) ⇒ Object
Monkeypatch to delete a file from both the local file system and Google Cloud Storage.
Instance Method Details
#delete(key) ⇒ Object
Monkeypatch to delete a file from both the local file system and Google Cloud Storage. Done atomically to prevent circular file syncing where files never get deleted.
26 27 28 29 30 31 32 33 34 |
# File 'lib/patched/storage.rb', line 26 def delete key file = content_filename key return unless File.exist?(file) && File.exist?(properties_filename) Filelock file do super Google::Cloud::Gemserver::GCS.delete_file file Google::Cloud::Gemserver::GCS.delete_file properties_filename end end |