Skip to content

Commit 9c6eece

Browse files
committed
Add example to try and reproduce failure.
1 parent d179982 commit 9c6eece

File tree

5 files changed

+117
-0
lines changed

5 files changed

+117
-0
lines changed

examples/pgfault/config.ru

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
require "pg"
4+
5+
run do |env|
6+
connection = PG.connect(dbname: "test")
7+
connection.close
8+
9+
[200, {"Content-Type" => "text/plain"}, ["Hello, World!"]]
10+
end

examples/pgfault/falcon.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
require "pg"
4+
require "falcon/environment/rack"
5+
6+
connection = PG.connect(dbname: "test")
7+
pp connection
8+
connection.close
9+
10+
service "hello.localhost" do
11+
include Falcon::Environment::Rack
12+
end

examples/pgfault/gems.locked

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
async (2.11.0)
5+
console (~> 1.25, >= 1.25.2)
6+
fiber-annotation
7+
io-event (~> 1.5, >= 1.5.1)
8+
timers (~> 4.1)
9+
async-container (0.18.2)
10+
async (~> 2.10)
11+
async-http (0.66.3)
12+
async (>= 2.10.2)
13+
async-pool (>= 0.6.1)
14+
io-endpoint (~> 0.10, >= 0.10.3)
15+
io-stream (~> 0.4)
16+
protocol-http (~> 0.26.0)
17+
protocol-http1 (~> 0.19.0)
18+
protocol-http2 (~> 0.17.0)
19+
traces (>= 0.10.0)
20+
async-http-cache (0.4.3)
21+
async-http (~> 0.56)
22+
async-pool (0.6.1)
23+
async (>= 1.25)
24+
async-service (0.12.0)
25+
async
26+
async-container (~> 0.16)
27+
console (1.25.2)
28+
fiber-annotation
29+
fiber-local (~> 1.1)
30+
json
31+
falcon (0.47.6)
32+
async
33+
async-container (~> 0.18)
34+
async-http (~> 0.66, >= 0.66.3)
35+
async-http-cache (~> 0.4.0)
36+
async-service (~> 0.10)
37+
bundler
38+
localhost (~> 1.1)
39+
openssl (~> 3.0)
40+
process-metrics (~> 0.2.0)
41+
protocol-rack (~> 0.5)
42+
samovar (~> 2.3)
43+
fiber-annotation (0.2.0)
44+
fiber-local (1.1.0)
45+
fiber-storage
46+
fiber-storage (0.1.0)
47+
io-endpoint (0.10.3)
48+
io-event (1.5.1)
49+
io-stream (0.4.0)
50+
json (2.7.2)
51+
localhost (1.3.1)
52+
mapping (1.1.1)
53+
openssl (3.2.0)
54+
pg (1.5.6)
55+
process-metrics (0.2.1)
56+
console (~> 1.8)
57+
samovar (~> 2.1)
58+
protocol-hpack (1.4.3)
59+
protocol-http (0.26.5)
60+
protocol-http1 (0.19.1)
61+
protocol-http (~> 0.22)
62+
protocol-http2 (0.17.0)
63+
protocol-hpack (~> 1.4)
64+
protocol-http (~> 0.18)
65+
protocol-rack (0.5.1)
66+
protocol-http (~> 0.23)
67+
rack (>= 1.0)
68+
rack (3.0.11)
69+
samovar (2.3.0)
70+
console (~> 1.0)
71+
mapping (~> 1.0)
72+
timers (4.3.5)
73+
traces (0.11.1)
74+
75+
PLATFORMS
76+
arm64-darwin-22
77+
78+
DEPENDENCIES
79+
falcon
80+
pg
81+
82+
BUNDLED WITH
83+
2.5.9

examples/pgfault/gems.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "pg"
6+
gem "falcon"

examples/pgfault/readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Instructions
2+
3+
- Create a data directory.
4+
- `initdb -D data/`
5+
- `pg_ctl -D data/ -l logfile start`
6+
- `createdb test`

0 commit comments

Comments
 (0)