Skip to content

request help:  #1510

Closed
Closed

Description

@OnlyPiglet

Issue description

can we inject into the exiting phase of nginx

Environment

  • apisix version (cmd: apisix version): v1.1
  • OS: centos

Activity

  1. ShiningRush commented on Apr 27, 2020

    @ShiningRush
    Contributor

    Here is all phase of openresty, I think you can use Log Phase as you mentioned "exiting phase".
    image

    If all of those phase can not help you, you can post a issue to openresty : )

  2. moonming commented on Apr 28, 2020

    @moonming
    Member

    Actually, OpenResty doesn't have the exit phase yet.

  3. moonming commented on Apr 28, 2020

    @moonming
    Member

    @ShiningRush @OnlyPiglet these is a PR for exit work phase: openresty/lua-nginx-module#1682

  4. OnlyPiglet commented on Apr 29, 2020

    @OnlyPiglet
    ContributorAuthor

    @ShiningRush @OnlyPiglet these is a PR for exit work phase: openresty/lua-nginx-module#1682

    thanks I see

  5. membphis commented on Jun 20, 2020

    @membphis
    Member

    can we inject into the exiting phase of nginx

    What do you need to do in the exit phase?

  6. OnlyPiglet commented on Jul 3, 2020

    @OnlyPiglet
    ContributorAuthor

    can we inject into the exiting phase of nginx

    What do you need to do in the exit phase?
    some other operations to react with other system when apisix is exit

  7. membphis commented on Jul 3, 2020

    @membphis
    Member

    here is a simple way to implement a fake exit phase, you can make a try.

    local delay = 60 * 10
    local handler
    handler = function (premature)
        if premature then
            -- add your code here, that is a fake `exit` phase
            return
        end
        
        ngx.sleep(delay)
        local ok, err = ngx.timer.at(delay, handler)
        if not ok then
            ngx.log(ngx.ERR, "failed to create the timer: ", err)
            return
        end
     end
    
    local ok, err = ngx.timer.at(0, handler)
    if not ok then
        return
    end
  8. OnlyPiglet commented on Aug 18, 2020

    @OnlyPiglet
    ContributorAuthor

    @membphis thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions