Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#14596 closed (fixed)

Cache backend initialization refactoring

Reported by: dauerbaustelle Owned by: nobody
Component: Core (Cache system) Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The attached patch refactors the initialization code shared between the locmem, filesystem and database cache backends into the BaseCache class' __init__ method.

Furthermore, it extends the tests so that the backends' code is tested with cull_frequency=0. (Filebased cache excluded, because it seems like its culling behaviour is somewhat unpredictable.)

Plus it puts the hairy pseudo-model stuff in the database cache backend into a superclass to make inheritance more obvious for 3rd-party database backends.

Attachments (1)

cache-refactor-initialization-and-cull-frequency-test.diff (4.5 KB) - added by dauerbaustelle 12 years ago.
Refactors cache backend initialization and adds cull frequency test.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by dauerbaustelle

Refactors cache backend initialization and adds cull frequency test.

comment:1 Changed 12 years ago by Russell Keith-Magee

Triage Stage: UnreviewedReady for checkin

comment:2 Changed 12 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [14434]) Fixed #14596 -- Light refactoring of the cache backends.

  • Removes some code duplication,
  • Provides a convenient base class for db-like cache backends
  • Adds tests for an edge case of culling,
  • Marks the memcached tests as "skipped", rather than omitting them.

Thanks to Jonas H for the patch.

comment:3 Changed 11 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top