fix: prevent nil-panic on server and improve OAuth callback handling
Load config eagerly during server startup so sortByUrgency never hits a nil config. Add nil-guard in BuildUrgencyCoefficients as belt-and-suspenders defense. Fix OAuth callback to support both GET and POST, and resolve issuer URLs properly with path.Dir. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -170,8 +170,12 @@ func (t *Task) urgencyProject(coeff float64) float64 {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
// BuildUrgencyCoefficients creates UrgencyCoefficients from config
|
||||
// BuildUrgencyCoefficients creates UrgencyCoefficients from config.
|
||||
// If cfg is nil, uses DefaultConfig() to prevent nil-pointer panics.
|
||||
func BuildUrgencyCoefficients(cfg *Config) *UrgencyCoefficients {
|
||||
if cfg == nil {
|
||||
cfg = DefaultConfig()
|
||||
}
|
||||
return &UrgencyCoefficients{
|
||||
Due: cfg.UrgencyDue,
|
||||
PriorityH: cfg.UrgencyPriorityH,
|
||||
|
||||
Reference in New Issue
Block a user