MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / Task

Class Task

botasaurus_server/botasaurus_server/models.py:122–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120
121
122class Task(Base):
123 __tablename__ = "tasks"
124
125 # Identifiers and status
126 id = Column(Integer, primary_key=True)
127 status = Column(String, index=True)
128
129 sort_id = Column(Integer, index=True) # Private sort id
130
131 # Task details
132 task_name = Column(String, index=True)
133 scraper_name = Column(String, index=True)
134 scraper_type = Column(String, index=True)
135 is_all_task = Column(Boolean, index=True)
136 is_sync = Column(Boolean, index=True) # Indexed column with default value False
137
138 # Parent task relationship (optional)
139 parent_task_id = Column(Integer, ForeignKey("tasks.id"), nullable=True)
140
141 started_at = Column(DateTime, nullable=True)
142 finished_at = Column(DateTime, nullable=True)
143
144 # Data fields
145 data = Column(JSON) # JSON field for storing task data
146 meta_data = Column(JSON) # JSON field for storing meta data
147 result_count = Column(
148 Integer, default=0
149 ) # Integer field for storing result count, default 0
150
151 # Timestamps
152 created_at = Column(DateTime, server_default=func.now())
153 updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
154
155 def to_json(self, with_result=True):
156 """Serializes all properties of the Task object into a JSON dictionary."""
157 return serialize_task(self, with_result)

Callers 3

perform_create_all_taskFunction · 0.70
createTaskFunction · 0.70
create_cached_taskFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected