first commit
This commit is contained in:
commit
677a836569
29 files changed
+1785
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import redis, os, sys
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
import config, libs
|
||||
|
||||
def main(cmd, order_id):
|
||||
if cmd == 'print':
|
||||
key = 'model:printOrder'
|
||||
elif cmd == 'repair':
|
||||
key = 'model:IndependentRepairTeamcheckGLBQueue'
|
||||
elif cmd == 'make3d':
|
||||
key = 'model:make'
|
||||
elif cmd == 'make3d10':
|
||||
key = 'model:make10'
|
||||
elif cmd == 'foot':
|
||||
key = 'model:foot'
|
||||
|
||||
if order_id == 'view':
|
||||
for i in r.lrange(key, 0, -1):
|
||||
print(i)
|
||||
print(f'当前{key}队列长度:{r.llen(key)}')
|
||||
else:
|
||||
order_ids = order_id.split(',')
|
||||
for order_id in order_ids:
|
||||
r.lpush(key, order_id)
|
||||
print(f'已推送{order_id}到{key}, 当前队列长度:{r.llen(key)}')
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) == 3:
|
||||
cmd = sys.argv[1]
|
||||
order_id = sys.argv[2]
|
||||
else:
|
||||
print('用法:python push_cmd.py <cmd> <order_id>')
|
||||
exit(1)
|
||||
|
||||
r = config.redis_local
|
||||
|
||||
main(cmd, order_id)
|
||||
Reference in new issue
Block a user