Skip to content

Commit abf3582

Browse files
committed
fix(LocalDatabase): support get local jobs with conditions
1 parent a6cda84 commit abf3582

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PollinationSDK/Wrapper/LocalDatabase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,14 @@ public List<ScheduledJobInfo> Get()
138138
return Get(connection, string.Empty);
139139
}
140140

141-
public List<ScheduledJobInfo> Get(string projSlug)
141+
public List<ScheduledJobInfo> Get(string projSlug, bool reversedOrder = false, int count = 10)
142142
{
143143
var condition = $"ProjSlug = '{projSlug}'";
144+
if (reversedOrder)
145+
condition += " ORDER BY DateTime DESC";
146+
if (count > 0)
147+
condition += $" LIMIT {count}";
148+
144149
return Get(connection, condition);
145150
}
146151
public ScheduledJobInfo Get(string projSlug, string jobID)

0 commit comments

Comments
 (0)