get_config_plugin does too many queries

Bug #887400 reported by Richard Mansfield
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Richard Mansfield

Bug Description

The get_config_plugin function fails to remember when a query for a particular value returns nothing, and queries the table again on every subsequent call. Also, it can be improved by reading entire <plugintype>_config tables (they're very small) instead of just reading values for one plugin at a time.

Changed in mahara:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Richard Mansfield (richard-mansfield)
milestone: none → 1.5.0
Revision history for this message
François Marier (fmarier) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/836
Committed: http://gitorious.org/mahara/mahara/commit/3d2ccd763cb8603f2c5f3ae03d221495061472bc
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit 3d2ccd763cb8603f2c5f3ae03d221495061472bc
Author: Richard Mansfield <email address hidden>
Date: Tue Nov 8 15:18:28 2011 +1300

    Cache undefined config values in get_config_plugin (bug #887400)

    When a plugin config value has not been set, multiple calls to
    get_config_plugin always trigger a db query. But if it's already
    queried once and found a null result, it should remember that for
    next time.

    Change-Id: Id955e0953131b83eba4e36face26bfb4ef828d26
    Signed-off-by: Richard Mansfield <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/835
Committed: http://gitorious.org/mahara/mahara/commit/b2e348702b5c9d77be08282260342b49376465ba
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit b2e348702b5c9d77be08282260342b49376465ba
Author: Richard Mansfield <email address hidden>
Date: Tue Nov 8 14:39:18 2011 +1300

    Read entire _config table on call to get_config_plugin (bug #887400)

    get_config_plugin only pulls in records from the given plugin, but it
    might as well read the entire (tiny) table, so that for example the
    following two calls result in one query rather than two:
     get_plugin_config('artefact', 'internal', 'profilemandatory')
     get_plugin_config('artefact', 'file', 'defaultquota')

    Change-Id: I28d74179330178a40d4787bdb9e8e4ed1e0a0e60
    Signed-off-by: Richard Mansfield <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Melissa Draper (melissa) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 status fixreleased
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPjqY0AAoJECXBtiziiXdcrpMIAKO5qOyhN9AQn9fCr32yAEba
wyQwhMOm1wS5eB4Qa29Hbr3c0xgXcwgsIFHfe0SCL92Gt2W3UjB8klrrRYssj5iu
o7DlmKBJhXo7i/AC005KeMTQZfY7ZX/tI8Lqux3FjfhSpRhCPatLLPr/hZHTbB4X
XXI47L8e304a6AwmDgsa9UUejDIjOwmOF7fFTeul8OgS4zSg3GUDQ1tTMW3+7Sns
YNmS3iU2+e0Z1CQlg5BqKwHVzCByuPPXuotvUkBkcLP53k1gUOn3OnMODTfbbrvf
UOVYo510SEKrkMCi0B4rLQHg8Ck2cUc1wS4GhxCOMrAcYDokjgTM98AerGB2sGE=
=uHSn
-----END PGP SIGNATURE-----

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.