Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2a031df
Quick draft of auto-cleaning functionality
Archmonger Jan 31, 2024
f8b99fc
remove auto_clean from config name
Archmonger Feb 1, 2024
685db22
Add type hinting to _cached_static_contents function
Archmonger Feb 1, 2024
eba80d3
ignore_config
Archmonger Feb 1, 2024
2e089de
docs cleanup
Archmonger Feb 1, 2024
4ea41f5
CLEAN_NEEDED_BY caching
Archmonger Feb 1, 2024
836d719
fix link
Archmonger Feb 1, 2024
dbf7e12
fix tests
Archmonger Feb 1, 2024
e1bd185
minor docs wordsmithing
Archmonger Feb 1, 2024
e2c088f
Merge remote-tracking branch 'upstream/main' into robust-cleanup-config
Archmonger Feb 1, 2024
43685b8
Add management command
Archmonger Feb 1, 2024
6c1ecf0
add changelog entries
Archmonger Feb 1, 2024
ef90460
Add checks for new config values
Archmonger Feb 1, 2024
5a57807
better interface for management command
Archmonger Feb 1, 2024
75670a8
ignore settings.py attributes for management command calls
Archmonger Feb 2, 2024
3594cee
add a check for common misspelling
Archmonger Feb 2, 2024
da855dd
Add comment for a bugfix
Archmonger Feb 2, 2024
107b64c
Auto-Clean Settings docs
Archmonger Feb 2, 2024
c6b8e13
fix a few stale docs lines
Archmonger Feb 2, 2024
43ee1ac
remove dead LOC
Archmonger Feb 2, 2024
2799ed0
Django Query Postprocessor docs cleanup
Archmonger Feb 2, 2024
e8fe1da
allow REACTPY_CLEAN_INTERVAL to be None
Archmonger Feb 2, 2024
08e1025
prepare for management command docs
Archmonger Feb 3, 2024
32ceea6
management command docs
Archmonger Feb 3, 2024
3385887
minor docs styling change
Archmonger Feb 3, 2024
e0c771d
avoid django timezone module
Archmonger Feb 3, 2024
05554dc
fix tests
Archmonger Feb 3, 2024
ad62a68
fix tests in a different way
Archmonger Feb 3, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix tests in a different way
  • Loading branch information
Archmonger committed Feb 3, 2024
commit ad62a6897aa1b6295896dff44a63d180ce0a3474
6 changes: 4 additions & 2 deletions src/reactpy_django/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
if TYPE_CHECKING:
from reactpy_django.models import Config

CLEAN_NEEDED_BY: datetime = datetime(year=1, month=1, day=1)
CLEAN_NEEDED_BY: datetime = datetime(
year=1, month=1, day=1, tzinfo=timezone.now().tzinfo
)


def clean(
Expand Down Expand Up @@ -115,7 +117,7 @@ def is_clean_needed(config: Config | None = None) -> bool:
if REACTPY_CLEAN_INTERVAL is None:
return False

if CLEAN_NEEDED_BY.year == 1 or timezone.now() >= CLEAN_NEEDED_BY:
if timezone.now() >= CLEAN_NEEDED_BY:
config = config or Config.load()
CLEAN_NEEDED_BY = config.cleaned_at + timedelta(seconds=REACTPY_CLEAN_INTERVAL)

Expand Down