Re: [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in.pgAdmin session and keep piling up - Mailing list pgadmin-hackers

From Dave Page
Subject Re: [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in.pgAdmin session and keep piling up
Date
Msg-id CA+OCxowKirRMve8S2WLcKkkdrMzwZ04C4hR+oo_rcGaTOep5CQ@mail.gmail.com
Whole thread Raw
In response to [pgAdmin4][Patch]: RM #3674 Old session files are not cleared in.pgAdmin session and keep piling up  (Akshay Joshi <akshay.joshi@enterprisedb.com>)
List pgadmin-hackers
Thanks, patch applied.

On Mon, Oct 8, 2018 at 2:00 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Hackers

Attached is the patch to fix the RM #3674 "Old session files are not cleared in .pgAdmin session and keep piling up". Patch contains following changes:
  • With current implementation we have override get_expiration_time() method of flask and return the expiry time as "datetime.datetime.now() + 1 day (hard coded)". Also the time used as now() instead of utcnow() which is there in base class method of flask.
    • Solution:  We should use session.permanent flag and set the permanent_session_lifetime variable of app. I have remove the overridden function and set the session.permanent flag to True, and set the permanent_session_lifetime with the specified value in config.py. Added new configuration parameter "SESSION_EXPIRATION_TIME_IN_DAYS".
  • Added CHECK_SESSION_FILES_INTERVAL configuration parameter in Hour with default value is 24. This is an interval to check the session files for the cleanup.    

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: pgAdmin 4 commit: Cleanup session files periodically. Fixes #3674
Next
From: Dave Page
Date:
Subject: Re: [pgAdmin4][RM3562] Migrate Bootstrap 3 to Bootstrap 4