Changeset 14045 in genesis


Ignore:
Timestamp:
Feb 3, 2018, 3:14:47 PM (7 years ago)
Author:
www
Message:

Fix updating of cache when no changes are done, hamering the system.

Update & cache generation is heavy loading, calling it as few as possible whould be nice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r14035 r14045  
    14961496    refresh_rate = 5
    14971497    output = "[INFO] Updating subverion, please wait...\n"
     1498    old_version = subprocess.Popen([SVNVERSION, '-c', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    14981499    output += subprocess.Popen([SVN, 'cleanup', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    14991500    output += subprocess.Popen([SVN, 'up', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
    1500     try:
    1501         generate_static(CACHE_DIR, False)
    1502     except:
    1503         output += traceback.format_exc()
    1504         refresh_rate = 120
    1505         pass
     1501    new_version = subprocess.Popen([SVNVERSION, '-c', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]
     1502    if old_version != new_version:
     1503        try:
     1504            generate_static(CACHE_DIR, False)
     1505        except:
     1506            output += traceback.format_exc()
     1507            refresh_rate = 120
     1508            pass
    15061509    output += "[INFO] All done, redirecting in %s seconds" % refresh_rate
    15071510    response_headers += [
Note: See TracChangeset for help on using the changeset viewer.