diff --git a/pastey/functions.py b/pastey/functions.py index 0564494..66b4cf6 100644 --- a/pastey/functions.py +++ b/pastey/functions.py @@ -8,9 +8,12 @@ from cryptography.fernet import Fernet import time import uuid import json +from os import environ ########## Paste functions ########## +config.recent_pastes = int(environ["PASTEY_RECENT_PASTES"]) if "PASTEY_RECENT_PASTES" in environ else config.recent_pastes + # Get recent n pastes, defined in config by recent_pastes def get_recent(limit=config.recent_pastes): paths = sorted(Path(config.data_directory).iterdir(), key=path.getmtime, reverse=True)