mootoday / ghost-v3-google-cloud-storage

A Google Cloud Storage adapter for Ghost v3 (www.ghost.org).
13 stars 7 forks source link

The images still in the bucket when try to remove #5

Closed susiloblogger closed 4 years ago

susiloblogger commented 4 years ago

Hi Mike, Is there any issue when try to remove the image from post setting column, because i've a problem when try to remove the image, it still founded in the bucket.

mikenikles commented 4 years ago

Hi Susilo, Ghost currently does not call this function. See https://forum.ghost.org/t/when-is-the-delete-method-in-storage-adapters-called/7495/2.

I implemented the delete function just in case Ghost changes their behavior in the future and starts calling it.

susiloblogger commented 4 years ago

@mikenikles i see... thanks, it made me stuck to thinking almost an hour to solved the problem, for the first thing i tried to change the user permission on gcs, but it doesn't works... 😅

mikenikles commented 4 years ago

Ah I remember it took me a moment too when I developed and tested the storage adapter. If you really, really wanted to clean up uploaded assets from GCS, I imagine there to be a solution with a Cloud Function that triggers once in a while and checks for assets in GCS that are not configured in Ghost. However... Unless you have thousands of unused assets, it's not worth the effort.