Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug while trying to insert or read records. [code inside] #140

Open
ashuezy opened this issue Jul 9, 2021 · 0 comments
Open

bug while trying to insert or read records. [code inside] #140

ashuezy opened this issue Jul 9, 2021 · 0 comments

Comments

@ashuezy
Copy link

ashuezy commented Jul 9, 2021

image

sql_operation(0, oneId, twoId, threeId, fc)

def sql_operation(w, oneId, twoId, threeId, fc):
	global code_folder
	fc2=0
	try:
		if w==0:
			try:
				mydict = SqliteDict(code_folder+'core.sqlite', autocommit=True)
				uid = str(oneId)+"_"+str(twoId)+"_"+str(threeId)
				mydict[uid] = fc
			except Exception as e0:
				logger.error(e0)
			finally:
				mydict.close()
		elif w==1:
			try:
				logger.info('Acquiring Lock by fetchRow')
				lock.acquire(timeout=5)
				logger.info('Lock Taken by fetchRow')
				mydict = SqliteDict(code_folder+'core.sqlite', autocommit=True)
				uid = str(oneId)+"_"+str(twoId)+"_"+str(threeId)
				fc2 = mydict[uid]
			except Exception as e1:
				logger.error(e1)
			finally:
				mydict.close()
				logger.info('Releasing Lock by fetchRow')
				lock.release()
				logger.info('Lock Released by fetchRow')
	except Exception as e:
		logger.error(e)
	return fc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant