Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>RAM is <em>volatile</em>, thus <em>not</em> persistent: memcached is not what you asked for.</li> <li><a href="http://harmful.cat-v.org/software/xml/" rel="nofollow noreferrer" title="Why XML sucks anyway">XML</a> it is <em>not</em> the right technology to store a single value.</li> <li>RDMS is <em>not</em> the right technology to store a single value.</li> <li>Django cache framework will answer your question if CACHE_BACKEND is set to anything else than <em>file://...</em></li> </ol> <p>The filesystem <em>is</em> the right technology to "persist a single value".</p> <p>In settings.py:</p> <pre><code> RSS_FETCH_DATETIME_PATH=os.path.join( os.path.abspath(os.path.dirname(__file__)), 'rss_fetch_datetime' ) </code></pre> <p>In your rss fetch script:</p> <pre><code> from django.conf import settings handler = open(RSS_FETCH_DATETIME_PATH, 'w+') handler.write(int(time.time())) handler.close() </code></pre> <p>Wherever you need to read it:</p> <pre><code> from django.conf import settings handler = open(RSS_FETCH_DATETIME_PATH, 'r+') timestamp = int(handler.read()) handler.close() </code></pre> <p>But cron <em>is</em> the right tool if you want to "run a command every day", for example at 5AM:</p> <pre><code> 0 5 * * * /path/to/manage.py runscript /path/to/retreive/script </code></pre> <p>Of course, you can still write the last update timestamp in a file at the end of the retreive script, and use it somewhere else, if that makes sense to you.</p> <p>Concluding by quoting Ken Thompson:</p> <blockquote> <p>One of my most productive days was throwing away 1000 lines of code.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload