mirror of
https://github.com/Xevion/thedrank.com.git
synced 2025-12-15 02:13:28 -06:00
fix global i
This commit is contained in:
@@ -8,7 +8,6 @@ viewcountpath = os.path.join('app', 'static', 'viewcount.dat')
|
|||||||
counter = Value('i', int(open(viewcountpath, 'r').read()))
|
counter = Value('i', int(open(viewcountpath, 'r').read()))
|
||||||
|
|
||||||
def getIncrement(n=1):
|
def getIncrement(n=1):
|
||||||
global i
|
|
||||||
with counter.get_lock():
|
with counter.get_lock():
|
||||||
counter.value += n
|
counter.value += n
|
||||||
open(viewcountpath, 'w').write(str(counter.value))
|
open(viewcountpath, 'w').write(str(counter.value))
|
||||||
|
|||||||
Reference in New Issue
Block a user