Last change
on this file since 1380 was
1380,
checked in by piv, 14 years ago
|
add section to flush zope database cache
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1380] | 1 | Flush cache section |
---|
| 2 | =================== |
---|
| 3 | |
---|
| 4 | A flushcache pipeline section flushes zope cache every so often, which has an |
---|
| 5 | effect of freeing up memory. This section is useful while performing migration |
---|
| 6 | on a weak system with a low memory. The flushcache section blueprint name is |
---|
| 7 | ``quintagroup.transmogrifier.flushcache``. |
---|
| 8 | |
---|
| 9 | A flushcache section takes an optional ``every`` option, which defaults to |
---|
| 10 | 1000; cache is being flushed every ``every`` items passing through the pipe. |
---|
| 11 | A flushcache section doesn't alter the items in any way: |
---|
| 12 | |
---|
| 13 | >>> flushcache = """ |
---|
| 14 | ... [transmogrifier] |
---|
| 15 | ... pipeline = |
---|
| 16 | ... source |
---|
| 17 | ... flushcache |
---|
| 18 | ... |
---|
| 19 | ... [source] |
---|
| 20 | ... blueprint = collective.transmogrifier.sections.tests.rangesource |
---|
| 21 | ... size = 10 |
---|
| 22 | ... |
---|
| 23 | ... [flushcache] |
---|
| 24 | ... blueprint = quintagroup.transmogrifier.flushcache |
---|
| 25 | ... every = 3 |
---|
| 26 | ... """ |
---|
| 27 | >>> registerConfig(u'quintagroup.transmogrifier.tests.flushcache', flushcache) |
---|
| 28 | |
---|
| 29 | We'll show caching is flushed using dedicated variable on dummy plone instance |
---|
| 30 | called 'cacheMinimized'. Which is a number of caches performed. |
---|
| 31 | |
---|
| 32 | >>> transmogrifier(u'quintagroup.transmogrifier.tests.flushcache') |
---|
| 33 | >>> transmogrifier.context.cacheMinimized |
---|
| 34 | 3 |
---|
Note: See
TracBrowser
for help on using the repository browser.