Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1521 from deis/1354-delete-logs
Browse files Browse the repository at this point in the history
fix(controller): remove application logs on delete
  • Loading branch information
Matthew Fisher committed Aug 13, 2014
2 parents aa98312 + 987b2d5 commit d2c97da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controller/api/models.py
Expand Up @@ -139,6 +139,10 @@ def create(self, *args, **kwargs):
def delete(self, *args, **kwargs):
for c in self.container_set.all():
c.destroy()
# delete application logs stored by deis/logger
path = os.path.join(settings.DEIS_LOG_DIR, self.id + '.log')
if os.path.exists(path):
os.remove(path)
return super(App, self).delete(*args, **kwargs)

def deploy(self, release, initial=False):
Expand Down
3 changes: 3 additions & 0 deletions controller/bin/boot
Expand Up @@ -48,6 +48,9 @@ done

cd /app

# give the deis user permissions to write to the volume mount
chown -R deis:deis /var/log/deis

# run an idempotent database migration
sudo -E -u deis ./manage.py syncdb --migrate --noinput

Expand Down

0 comments on commit d2c97da

Please sign in to comment.