Skip to content

Commit

Permalink
Merge pull request web2py#1495 from niphlod/fix/appadmin_ccache
Browse files Browse the repository at this point in the history
fix ccache page in appadmin, thanks MDSIII
  • Loading branch information
mdipierro authored Oct 14, 2016
2 parents df35248 + 39e8cfb commit 8c252e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
9 changes: 4 additions & 5 deletions applications/admin/controllers/appadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def select():

if is_imap:
step = 3

stop = start + step

table = None
Expand Down Expand Up @@ -409,7 +409,7 @@ def ccache():
import copy
import time
import math
from gluon import portalocker
from pydal.contrib import portalocker

ram = {
'entries': 0,
Expand All @@ -421,7 +421,7 @@ def ccache():
'oldest': time.time(),
'keys': []
}

disk = copy.copy(ram)
total = copy.copy(ram)
disk['keys'] = []
Expand Down Expand Up @@ -465,8 +465,7 @@ def GetInHMS(seconds):
ram['keys'].append((key, GetInHMS(time.time() - value[0])))

for key in cache.disk.storage:
value = cache.disk.storage[key]
if isinstance(value[1], dict):
if key == 'web2py_cache_statistics' and isinstance(value[1], dict):
disk['hits'] = value[1]['hit_total'] - value[1]['misses']
disk['misses'] = value[1]['misses']
try:
Expand Down
9 changes: 4 additions & 5 deletions applications/examples/controllers/appadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def select():

if is_imap:
step = 3

stop = start + step

table = None
Expand Down Expand Up @@ -409,7 +409,7 @@ def ccache():
import copy
import time
import math
from gluon import portalocker
from pydal.contrib import portalocker

ram = {
'entries': 0,
Expand All @@ -421,7 +421,7 @@ def ccache():
'oldest': time.time(),
'keys': []
}

disk = copy.copy(ram)
total = copy.copy(ram)
disk['keys'] = []
Expand Down Expand Up @@ -465,8 +465,7 @@ def GetInHMS(seconds):
ram['keys'].append((key, GetInHMS(time.time() - value[0])))

for key in cache.disk.storage:
value = cache.disk.storage[key]
if isinstance(value[1], dict):
if key == 'web2py_cache_statistics' and isinstance(value[1], dict):
disk['hits'] = value[1]['hit_total'] - value[1]['misses']
disk['misses'] = value[1]['misses']
try:
Expand Down
3 changes: 1 addition & 2 deletions applications/welcome/controllers/appadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,7 @@ def GetInHMS(seconds):
ram['keys'].append((key, GetInHMS(time.time() - value[0])))

for key in cache.disk.storage:
value = cache.disk.storage[key]
if isinstance(value[1], dict):
if key == 'web2py_cache_statistics' and isinstance(value[1], dict):
disk['hits'] = value[1]['hit_total'] - value[1]['misses']
disk['misses'] = value[1]['misses']
try:
Expand Down

0 comments on commit 8c252e9

Please sign in to comment.