diff options
author | Dennis Eriksen <d@ennis.no> | 2023-02-01 20:32:11 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-02-01 20:32:11 +0100 |
commit | 8d186d39483beff64a1c11f80c6ca5e56dd7bbc5 (patch) | |
tree | 2c5a64ace4bd8eabd4d65014c5313bd7edd76191 /common/queue.py | |
parent | run queue in batches (diff) | |
download | energyscripts-8d186d39483beff64a1c11f80c6ca5e56dd7bbc5.tar.gz |
moving and renaming/breaking everything
Diffstat (limited to 'common/queue.py')
-rw-r--r-- | common/queue.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/common/queue.py b/common/queue.py deleted file mode 100644 index e567fb4..0000000 --- a/common/queue.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -''' common functions and stuff ''' - -import os -import sys -import pickle -from litequeue import SQLQueue - -QUEUE_DB = os.environ.get('el_QUEUE_db', 'litequeue.db') - -# Initialize queue -q = SQLQueue(QUEUE_DB, maxsize=None) - -def dbi(sql,values,**kwargs): - verbose = bool(kwargs['verbose']) if 'verbose' in kwargs else False - - q.put(pickle.dumps([sql, values])) - if verbose is True: - table = sql.split(' ')[2] - num = 1 if isinstance(values, tuple) else len(values) - print("Inserted", num, "item(s) into queue for", table) - return True |