From 12f320f271a6126567fc51d284fc21b930ca3b2e Mon Sep 17 00:00:00 2001 From: Qiang Date: Sat, 30 Sep 2023 21:36:08 -0700 Subject: [PATCH] no rockdb --- gomoku/script/tornado_server.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gomoku/script/tornado_server.py b/gomoku/script/tornado_server.py index 6c3ef9283fc..04806551313 100644 --- a/gomoku/script/tornado_server.py +++ b/gomoku/script/tornado_server.py @@ -3,17 +3,16 @@ import sys import tornado.ioloop -from divided_solution_manager import apply_all_transformation_for_steps_str, apply_transformation, find_next_steps_from_board_str_db from tornado import options from tornado import web from tornado.log import app_log -import rocksdb + +from divided_solution_manager import find_next_steps_from_board_str_hash2action, get_all_step_str2action options.options["log_file_prefix"] = "tornado_log" options.parse_command_line() - -db = rocksdb.DB("no_restrituion_gomoku.db", rocksdb.Options(create_if_missing=True), read_only=True) +all_step_str2action = get_all_step_str2action() class MainHandler(tornado.web.RequestHandler): @@ -22,7 +21,7 @@ def get(self): self.set_header('Content-type', 'application/json') self.set_header('Access-Control-Allow-Origin', '*') steps_url = self.get_argument("stepsString").strip("_") - possible_moves = find_next_steps_from_board_str_db(steps_url, db) + possible_moves = find_next_steps_from_board_str_hash2action(steps_url, all_step_str2action) if len(possible_moves) > 0: next_move = possible_moves[0]