Skip to content

Commit

Permalink
Merge pull request #154 from HSF/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wguanicedew authored Apr 25, 2023
2 parents 349121a + f82f61b commit 7ef8541
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion main/lib/idds/core/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ def select_agent(name, newer_than=3600, session=None):
if selected_agent['status'] != HealthStatus.Active:
orm_health.update_health_item_status(selected_agent, status=HealthStatus.Active, session=session)
for health_item in health_items:
if health_item['status'] == HealthStatus.Active and health_item != selected_agent:
if health_item['agent'] == name and health_item['status'] == HealthStatus.Active and health_item['health_id'] != selected_agent['health_id']:
orm_health.update_health_item_status(selected_agent, status=HealthStatus.Default, session=session)
return selected_agent
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""
from alembic import op
from alembic import context
import sqlalchemy as sa


# revision identifiers, used by Alembic.
Expand All @@ -30,14 +29,15 @@
def upgrade() -> None:
if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
op.alter_column('messages', sa.Column('request_id'), nullable=True, schema=schema)
op.alter_column('messages', sa.Column('transform_id'), nullable=True, schema=schema)
op.alter_column('messages', sa.Column('processing_id'), nullable=True, schema=schema)
op.alter_column('messages', 'request_id', nullable=True, schema=schema)
op.alter_column('messages', 'transform_id', nullable=True, schema=schema)
op.alter_column('messages', 'processing_id', nullable=True, schema=schema)


def downgrade() -> None:
if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
op.alter_column('messages', sa.Column('request_id'), nullable=False, schema=schema)
op.alter_column('messages', sa.Column('transform_id'), nullable=False, schema=schema)
op.alter_column('messages', sa.Column('processing_id'), nullable=False, schema=schema)
# here doesn't update nullable to False, since the table may have null rows which will cause failure.
op.alter_column('messages', 'request_id', nullable=True, schema=schema)
op.alter_column('messages', 'transform_id', nullable=True, schema=schema)
op.alter_column('messages', 'processing_id', nullable=True, schema=schema)

0 comments on commit 7ef8541

Please sign in to comment.