Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !9 opened Feb 21, 2014 by Guba Sándor@gubasandor 
  • Report abuse
Report abuse

Garbage Collector

  • Discussion 12
  • Commits 7
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 23, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/tasks/periodic_tasks.py
    8 logger = logging.getLogger(__name__)
    9
    10
    11 @celery.task
    12 def garbage_collector():
    13 logging.warning("Deletable disks:")
    14 for ds in DataStore.objects.all():
    15 one_week_before = timezone.now() - timedelta(days=7)
    16 file_list = os.listdir(ds.path)
    17 disk_list = [disk.filename for disk in
    18 ds.disk_set.filter(destroyed__lt=one_week_before)]
    19 for i in set(file_list).intersection(disk_list):
    20 abs_path = ds.path + "/" + i
    21 logging.warning(i + " - " +
    22 str(os.path.getsize(abs_path) / 1024 / 1024))
    23 #os.unlink(abs_path)
    • Őry Máté @orymate commented Feb 23, 2014
      Owner

      We could maybe move them to a separate folder (if we are afraid of data loss)?

      We could maybe move them to a separate folder (if we are afraid of data loss)?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      ok

      ok
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 23, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/tasks/periodic_tasks.py
    16 file_list = os.listdir(ds.path)
    17 disk_list = [disk.filename for disk in
    18 ds.disk_set.filter(destroyed__lt=one_week_before)]
    19 for i in set(file_list).intersection(disk_list):
    20 abs_path = ds.path + "/" + i
    21 logging.warning(i + " - " +
    22 str(os.path.getsize(abs_path) / 1024 / 1024))
    23 #os.unlink(abs_path)
    24
    25 logging.warning("Orphan disks:")
    26 for ds in DataStore.objects.all():
    27 one_week_before = timezone.now() - timedelta(days=7)
    28 file_list = os.listdir(ds.path)
    29 disk_list = [disk.filename for disk in ds.disk_set.all()]
    30 for i in set(file_list).difference(disk_list):
    31 if "dump" not in i:
    • Őry Máté @orymate commented Feb 23, 2014
      Owner

      This can be theoretically true for an uuid

      This can be theoretically true for an uuid
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      ok

      ok
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 23, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/tasks/periodic_tasks.py
    15 one_week_before = timezone.now() - timedelta(days=7)
    16 file_list = os.listdir(ds.path)
    17 disk_list = [disk.filename for disk in
    18 ds.disk_set.filter(destroyed__lt=one_week_before)]
    19 for i in set(file_list).intersection(disk_list):
    20 abs_path = ds.path + "/" + i
    21 logging.warning(i + " - " +
    22 str(os.path.getsize(abs_path) / 1024 / 1024))
    23 #os.unlink(abs_path)
    24
    25 logging.warning("Orphan disks:")
    26 for ds in DataStore.objects.all():
    27 one_week_before = timezone.now() - timedelta(days=7)
    28 file_list = os.listdir(ds.path)
    29 disk_list = [disk.filename for disk in ds.disk_set.all()]
    30 for i in set(file_list).difference(disk_list):
    • Őry Máté @orymate commented Feb 23, 2014
      Owner

      set - set is a much more readable syntax.

      Edited Feb 23, 2014
      `set - set` is a much more readable syntax.
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      ok 0bd5e524

      ok 0bd5e52
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 23, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/tasks/periodic_tasks.py
    28 file_list = os.listdir(ds.path)
    29 disk_list = [disk.filename for disk in ds.disk_set.all()]
    30 for i in set(file_list).difference(disk_list):
    31 if "dump" not in i:
    32 abs_path = ds.path + "/" + i
    33 logging.warning(i + " - " +
    34 str(os.path.getsize(abs_path) / 1024 / 1024))
    35
    36 logging.warning("Missing disks:")
    37 for ds in DataStore.objects.all():
    38 one_week_before = timezone.now() - timedelta(days=7)
    39 file_list = os.listdir(ds.path)
    40 disk_list = [disk.filename for disk in
    41 ds.disk_set.filter(destroyed__isnull=False)]
    42 for i in set(disk_list).difference(file_list):
    43 logging.warning(i)
    • Őry Máté @orymate commented Feb 23, 2014
      Owner

      Critical? What can we do at all?

      Critical? What can we do at all?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      ok

      ok
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 23, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/tasks/periodic_tasks.py
    19 for i in set(file_list).intersection(disk_list):
    20 abs_path = ds.path + "/" + i
    21 logging.warning(i + " - " +
    22 str(os.path.getsize(abs_path) / 1024 / 1024))
    23 #os.unlink(abs_path)
    24
    25 logging.warning("Orphan disks:")
    26 for ds in DataStore.objects.all():
    27 one_week_before = timezone.now() - timedelta(days=7)
    28 file_list = os.listdir(ds.path)
    29 disk_list = [disk.filename for disk in ds.disk_set.all()]
    30 for i in set(file_list).difference(disk_list):
    31 if "dump" not in i:
    32 abs_path = ds.path + "/" + i
    33 logging.warning(i + " - " +
    34 str(os.path.getsize(abs_path) / 1024 / 1024))
    • Őry Máté @orymate commented Feb 23, 2014
      Owner

      What can we do? How does a disk become orphan?

      What can we do? How does a disk become orphan?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      ok

      ok
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 23, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/tasks/periodic_tasks.py
    5 from manager.mancelery import celery
    6 import logging
    7
    8 logger = logging.getLogger(__name__)
    9
    10
    11 @celery.task
    12 def garbage_collector():
    13 logging.warning("Deletable disks:")
    14 for ds in DataStore.objects.all():
    15 one_week_before = timezone.now() - timedelta(days=7)
    16 file_list = os.listdir(ds.path)
    17 disk_list = [disk.filename for disk in
    18 ds.disk_set.filter(destroyed__lt=one_week_before)]
    19 for i in set(file_list).intersection(disk_list):
    20 abs_path = ds.path + "/" + i
    • Őry Máté @orymate commented Feb 23, 2014
      Owner

      path.join?

      `path.join`?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      removed

      removed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on commit 0bd5e524 Feb 26, 2014
    • Őry Máté @orymate

      mentioned in merge request !9 (merged)

      Feb 26, 2014

      mentioned in merge request !9 (merged)

      mentioned in merge request !9
      Toggle commit list
    Please register or sign in to reply
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Guba Sándor
Assignee
Guba Sándor @gubasandor
Assign to
Pilot deploy
Milestone
Pilot deploy
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/cloud!9