Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#14596 closed (fixed)

Cache backend initialization refactoring

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

Description

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 5 years ago.
Refactors cache backend initialization and adds cull frequency test.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by dauerbaustelle

Refactors cache backend initialization and adds cull frequency test.

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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