Compare commits
3 Commits
a942e23b39
...
f1867c1010
Author | SHA1 | Date | |
---|---|---|---|
f1867c1010 | |||
62de443d3b | |||
14be8d3d8e |
5
LICENSE
5
LICENSE
@ -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
|
||||
|
16
README.adoc
16
README.adoc
@ -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
15
main.go
@ -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)
|
||||
|
Reference in New Issue
Block a user