fix: jobs router session handling, schedule creation, and tests
- Use new session in background task for thread safety - Fix schedule creation to associate with job - Fix schedule endpoint return type - Update tests to use AsyncClient - Add missing tests for list, get, delete, schedule - Add updated_at field to Schedule model
This commit is contained in:
@@ -63,6 +63,11 @@ class Schedule(Base):
|
||||
cron_expression = Column(String, nullable=False)
|
||||
enabled = Column(Boolean, default=True)
|
||||
created_at = Column(DateTime, default=lambda: datetime.now(timezone.utc))
|
||||
updated_at = Column(
|
||||
DateTime,
|
||||
default=lambda: datetime.now(timezone.utc),
|
||||
onupdate=lambda: datetime.now(timezone.utc),
|
||||
)
|
||||
|
||||
job = relationship("Job", back_populates="schedule")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user