Skip to content

Commit

Permalink
Merge pull request #264 from negillett/22675
Browse files Browse the repository at this point in the history
Reduce default arc_threshold of garbage collect [RHELDST-22675]
  • Loading branch information
negillett committed Feb 15, 2024
2 parents 85ecb08 + 545991d commit 3970345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
7 changes: 3 additions & 4 deletions pubtools/_pulp/tasks/garbage_collect.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import logging
from datetime import datetime, timedelta
import os
from datetime import datetime, timedelta

from pubtools.pulplib import Criteria, Matcher, RpmUnit

from pubtools._pulp.task import PulpTask
from pubtools._pulp.services import PulpClientService

from pubtools._pulp.task import PulpTask

LOG = logging.getLogger("pubtools.pulp")
step = PulpTask.step
Expand Down Expand Up @@ -39,7 +38,7 @@ def add_args(self):
"--arc-threshold",
help="delete all-rpm-content older than this many days",
type=int,
default=30,
default=14,
)

def run(self):
Expand Down
20 changes: 5 additions & 15 deletions tests/garbage_collect/test_garbage_collect.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import os
import datetime

import pytest
import datetime
from mock import Mock, patch
from mock import patch
from more_executors.futures import f_return
from pubtools.pulplib import FakeController, Repository, RpmUnit, Task

from pubtools.pulplib import (
FakeController,
Repository,
RpmUnit,
RpmDependency,
YumRepository,
Task,
InvalidDataException,
)

from pubtools._pulp.tasks.garbage_collect import GarbageCollect, entry_point
import pubtools._pulp.tasks.garbage_collect as gc_module
from pubtools._pulp.tasks.garbage_collect import GarbageCollect, entry_point


@pytest.fixture
Expand Down Expand Up @@ -330,4 +320,4 @@ def test_arc_garbage_collect_0items(mock_logger):
gc.main()
updated_rpm = list(client.get_repository("all-rpm-content").search_content())
assert len(updated_rpm) == 1
mock_logger.info.assert_any_call("No all-rpm-content found older than %s", 30)
mock_logger.info.assert_any_call("No all-rpm-content found older than %s", 14)

0 comments on commit 3970345

Please sign in to comment.