Compare commits

...

3 Commits

Author SHA1 Message Date
f1867c1010
Improve shutdown sequence 2019-04-19 17:14:52 +02:00
62de443d3b
Update README 2018-06-24 03:53:20 +02:00
14be8d3d8e
Relicense to 0BSD, update mail address
I've come to the conclusion that copyright mostly just stands in the way
of software development.  In my jurisdiction I cannot give up my own
copyright and 0BSD seems to be the closest thing to public domain.

The updated mail address, also used in my author/committer lines,
is shorter and looks nicer.  People rarely interact anyway.
2018-06-24 03:53:02 +02:00
3 changed files with 16 additions and 20 deletions

View File

@ -1,8 +1,7 @@
Copyright (c) 2017, Přemysl Janouch <p.janouch@gmail.com>
Copyright (c) 2017, Přemysl Janouch <p@janouch.name>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF

View File

@ -34,16 +34,12 @@ be run in a dedicated directory.
Contributing and Support
------------------------
Use https://git.janouch.name/p/gitea-obs to report any bugs, request features,
or submit pull requests. If you want to discuss this project, or maybe just
hang out with the developer, feel free to join me at irc://irc.janouch.name,
channel #dev.
or submit pull requests. `git send-email` is tolerated. If you want to discuss
the project, feel free to join me at ircs://irc.janouch.name, channel #dev.
Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9
License
-------
'gitea-obs' is written by Přemysl Janouch <p.janouch@gmail.com>.
You may use the software under the terms of the ISC license, the text of which
is included within the package, or, at your option, you may relicense the work
under the MIT or the Modified BSD License, as listed at the following site:
http://www.gnu.org/licenses/license-list.html
This software is released under the terms of the 0BSD license, the text of which
is included within the package along with the list of authors.

15
main.go
View File

@ -191,12 +191,8 @@ func main() {
server := &http.Server{Addr: listenAddr}
// Run the producer
go func() {
if err := server.ListenAndServe(); err != nil &&
err != http.ErrServerClosed {
log.Fatalln(err)
}
}()
errs := make(chan error, 1)
go func() { errs <- server.ListenAndServe() }()
// Run the consumer
ctx, ctxCancel := context.WithCancel(context.Background())
@ -217,7 +213,12 @@ func main() {
// Wait for a termination signal
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
<-sigs
select {
case <-sigs:
case err := <-errs:
log.Println(err)
}
// Stop the producer gracefully
ctxSd, ctxSdCancel := context.WithTimeout(context.Background(), 5)