Cache helpers
cache(pkg_id)
¶
Adds the package id and current time to the 'twitter' cache. Clears any existing entries for the given package id first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pkg_id |
The package id to store. |
required |
Source code in ckanext/twitter/lib/cache_helpers.py
19 20 21 22 23 24 25 26 27 | |
expired(pkg_id)
¶
Checks to see if the cache entry for the package's last tweet (if any) is old enough to be overwritten.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pkg_id |
The package ID. |
required |
Returns:
| Type | Description |
|---|---|
|
boolean |
Source code in ckanext/twitter/lib/cache_helpers.py
48 49 50 51 52 53 54 55 56 57 58 59 60 | |
remove_from_cache(pkg_id)
¶
Remove the package id from the cache.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pkg_id |
|
required |
Source code in ckanext/twitter/lib/cache_helpers.py
39 40 41 42 43 44 45 | |
reset_cache()
¶
Clears everything from the 'twitter' cache.
Source code in ckanext/twitter/lib/cache_helpers.py
30 31 32 33 34 35 36 | |