File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,23 @@ profiles:
136
136
#
137
137
close_on_passing : false
138
138
139
+ # Close on passing minimum wait
140
+ #
141
+ # When the close on passing feature is activated, voting will conclude once
142
+ # the pass threshold is met. However, there may be instances where it is
143
+ # preferable to implement a minimum wait time, even if the vote would
144
+ # already pass. This allows participants sufficient opportunity to engage
145
+ # and reflect before the vote is automatically finalized.
146
+ #
147
+ # Units supported:
148
+ #
149
+ # - day / days
150
+ # - week / weeks
151
+ #
152
+ # close_on_passing_min_wait: "1 week"
153
+ #
154
+ close_on_passing_min_wait : null
155
+
139
156
# Announcements
140
157
#
141
158
# GitVote can announce the results of a vote when it is closed on GitHub
Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ pub(crate) struct CfgProfile {
84
84
pub periodic_status_check : Option < String > ,
85
85
#[ serde( skip_serializing_if = "Option::is_none" ) ]
86
86
pub close_on_passing : Option < bool > ,
87
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
88
+ pub close_on_passing_min_wait : Option < String > ,
87
89
}
88
90
89
91
impl CfgProfile {
Original file line number Diff line number Diff line change @@ -190,6 +190,12 @@ impl DB for PgDB {
190
190
where closed = false
191
191
and cfg ? 'close_on_passing'
192
192
and (cfg->>'close_on_passing')::boolean = true
193
+ and
194
+ case
195
+ when cfg ? 'close_on_passing_min_wait' and string_to_interval(cfg->>'close_on_passing_min_wait') is not null then
196
+ current_timestamp > created_at + (cfg->>'close_on_passing_min_wait')::interval
197
+ else true
198
+ end
193
199
" ,
194
200
& [ ] ,
195
201
)
You can’t perform that action at this time.
0 commit comments