fix: DBPools Singleton - manually set db.databases after getting instance
This commit is contained in:
parent
22820b85cd
commit
34fd3ada5c
@ -363,7 +363,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
# High priority memories
|
# High priority memories
|
||||||
ns = {'user_id': user_id, 'priority__gte': self.config.high_priority_threshold, 'sort': 'priority desc,last_accessed desc'}
|
ns = {'user_id': user_id, 'priority__gte': self.config.high_priority_threshold, 'sort': 'priority desc,last_accessed desc'}
|
||||||
@ -418,7 +420,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
memories = await sor.R('hermes_memory', {'id': memory_id, 'user_id': user_id})
|
memories = await sor.R('hermes_memory', {'id': memory_id, 'user_id': user_id})
|
||||||
if memories:
|
if memories:
|
||||||
@ -442,7 +446,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
# Calculate cutoff date
|
# Calculate cutoff date
|
||||||
cutoff_date = datetime.now().replace(
|
cutoff_date = datetime.now().replace(
|
||||||
@ -549,7 +555,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
if action == "add":
|
if action == "add":
|
||||||
memory_id = str(uuid.uuid4())
|
memory_id = str(uuid.uuid4())
|
||||||
@ -665,7 +673,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
filters = {'user_id': user_id}
|
filters = {'user_id': user_id}
|
||||||
if query:
|
if query:
|
||||||
@ -710,7 +720,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
if action == "view":
|
if action == "view":
|
||||||
filters = {'user_id': user_id, 'name': name}
|
filters = {'user_id': user_id, 'name': name}
|
||||||
@ -797,7 +809,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
if action == "create":
|
if action == "create":
|
||||||
# Create new remote skill configuration
|
# Create new remote skill configuration
|
||||||
@ -1205,7 +1219,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
workflows = await sor.R('hermes_workflows', {'sort': 'created_at desc', 'user_id': user_id})
|
workflows = await sor.R('hermes_workflows', {'sort': 'created_at desc', 'user_id': user_id})
|
||||||
return {"success": True, "workflows": workflows or [], "user_id": user_id}
|
return {"success": True, "workflows": workflows or [], "user_id": user_id}
|
||||||
@ -1220,7 +1236,9 @@ class HermesAgent:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
filters = {'user_id': user_id}
|
filters = {'user_id': user_id}
|
||||||
if workflow_id:
|
if workflow_id:
|
||||||
|
|||||||
@ -88,7 +88,9 @@ class HermesOrchestrator:
|
|||||||
workflow_id = str(uuid.uuid4())
|
workflow_id = str(uuid.uuid4())
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
data = {
|
data = {
|
||||||
'id': workflow_id,
|
'id': workflow_id,
|
||||||
@ -123,7 +125,9 @@ class HermesOrchestrator:
|
|||||||
# Verify workflow exists and belongs to user
|
# Verify workflow exists and belongs to user
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
workflows = await sor.R('hermes_workflows', {
|
workflows = await sor.R('hermes_workflows', {
|
||||||
'id': workflow_id,
|
'id': workflow_id,
|
||||||
@ -189,7 +193,9 @@ class HermesOrchestrator:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
# Load workflow
|
# Load workflow
|
||||||
workflows = await sor.R('hermes_workflows', {
|
workflows = await sor.R('hermes_workflows', {
|
||||||
@ -486,7 +492,9 @@ class HermesOrchestrator:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
data = {
|
data = {
|
||||||
'id': execution_id,
|
'id': execution_id,
|
||||||
@ -509,7 +517,9 @@ class HermesOrchestrator:
|
|||||||
try:
|
try:
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
|
|
||||||
db = DBPools(config.databases)
|
db = DBPools()
|
||||||
|
|
||||||
|
db.databases = config.databases
|
||||||
async with db.sqlorContext('harnessed_agent') as sor:
|
async with db.sqlorContext('harnessed_agent') as sor:
|
||||||
end_time = datetime.now()
|
end_time = datetime.now()
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user