File tree 4 files changed +37
-1
lines changed
4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ terraform.tfstate
9
9
terraform.tfstate.backup
10
10
** /.tfplan. *
11
11
tests /periodic-test /build-template /e2b.toml
12
+ .air
Original file line number Diff line number Diff line change
1
+ root = " ."
2
+ tmp_dir = " .air"
3
+
4
+ [build ]
5
+ cmd = " CGO_ENABLED=1 go build -race -gcflags=all=\" -N -l\" -o bin/api ."
6
+ bin = " bin/api"
7
+ full_bin = " ENV=$(cat ../../.last_used_env || echo \" not-set\" ) && . ../../.env.${ENV} && POSTGRES_CONNECTION_STRING=${POSTGRES_CONNECTION_STRING} SUPABASE_JWT_SECRETS=${SUPABASE_JWT_SECRETS} GOTRACEBACK=crash GODEBUG=madvdontneed=1 TEMPLATE_BUCKET_NAME=${TEMPLATE_BUCKET_NAME} ENVIRONMENT=${ENVIRONMENT} ORCHESTRATOR_PORT=5008 bin/api --port 3000"
8
+ include_ext = [" go" , " yml" , " yaml" ]
9
+ exclude_dir = [" assets" , " .air" , " vendor" , " bin" ]
10
+ exclude_regex = [" _test\\ .go" ]
11
+ exclude_unchanged = true
12
+ delay = 500
13
+ send_interrupt = true # not sure this is actually needed
14
+
15
+ [log ]
16
+ time = true
17
+
18
+ [screen ]
19
+ clear_on_rebuild = false
Original file line number Diff line number Diff line change 35
35
ORCHESTRATOR_PORT=5008 \
36
36
./bin/api --port 3000
37
37
38
+ # Run the API using air
39
+ .PHONY : dev-init
40
+ dev-init :
41
+ go install github.com/air-verse/air@latest
42
+
43
+ .PHONY : dev
44
+ dev :
45
+ @if [ ! -f " ${GOPATH} /bin/air" ]; then \
46
+ echo " air not found in ${GOPATH} /bin/air, please run 'make dev-init' first" ; \
47
+ exit 1; \
48
+ fi
49
+ ${GOPATH} /bin/air
38
50
39
51
# You run the parametrized command like this:
40
52
# make metric=heap interval=90 profiler
Original file line number Diff line number Diff line change @@ -325,7 +325,11 @@ func run() int {
325
325
// This is a bit of a hack, but this way we can properly propagate
326
326
// the health status to the load balancer.
327
327
apiStore .Healthy = false
328
- time .Sleep (15 * time .Second )
328
+
329
+ // Skip the delay in local environment for instant shutdown
330
+ if ! env .IsLocal () {
331
+ time .Sleep (15 * time .Second )
332
+ }
329
333
330
334
// if the parent context `ctx` is canceled the
331
335
// shutdown will return early. This should only happen
You can’t perform that action at this time.
0 commit comments